harmony 鸿蒙Previewing Development
Previewing Development
When to Use
Use the camera module APIs to generate and play video streams.
Available APIs
For details, see Available APIs.
Constraints
None
How to Develop
Perform step 1 through step 4 described in Photographing Development.
Set the preview area.
Surface *surface = Surface::CreateSurface();
/* Set the display area. */
surface->SetUserData("region_position_x", "480"); // X-coordinate of the upper left corner of the rectangle.
surface->SetUserData("region_position_y", "270"); // Y-coordinate of the upper left corner of the rectangle.
surface->SetUserData("region_width", "960"); // Width.
surface->SetUserData("region_height", "540"); // Height.
fc->AddSurface(*surface);
- Start and stop previewing.
stateCallback->camera_->TriggerLoopingCapture(*fc); // Start previewing.
stateCallback->camera_->StopLoopingCapture(); // Stop previewing.
你可能感兴趣的鸿蒙文章
harmony 鸿蒙AI Framework Development Guide
harmony 鸿蒙NNRt Access Adaptation
harmony 鸿蒙Application Privilege Configuration
harmony 鸿蒙Setting Up a Development Environment
harmony 鸿蒙Development Guidelines
harmony 鸿蒙Application Framework Overview
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦