1e41f4b71Sopenharmony_ci# Previewing<a name="EN-US_TOPIC_0000001055394496"></a> 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci## When to Use<a name="en-us_topic_0000001051930577_section186634310418"></a> 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciUse the camera module APIs to generate and play video streams. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci## Available APIs<a name="en-us_topic_0000001051930577_section125479541744"></a> 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ciFor details, see the available APIs described in development guidelines on photographing. 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci## Limitations and Constraints<a name="en-us_topic_0000001051930577_section1165911177314"></a> 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciNone 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## How to Develop<a name="en-us_topic_0000001051930577_section34171333656"></a> 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci1. Perform step 1 through step 4 described in development guidelines on photographing. 18e41f4b71Sopenharmony_ci2. Set the preview area. 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci ``` 21e41f4b71Sopenharmony_ci Surface *surface = Surface::CreateSurface(); 22e41f4b71Sopenharmony_ci /* Set the display area. */ 23e41f4b71Sopenharmony_ci surface->SetUserData("region_position_x", "480"); // X-coordinate of the upper left corner of the rectangle 24e41f4b71Sopenharmony_ci surface->SetUserData("region_position_y", "270"); // Y-coordinate of the upper left corner of the rectangle 25e41f4b71Sopenharmony_ci surface->SetUserData("region_width", "960"); // Width 26e41f4b71Sopenharmony_ci surface->SetUserData("region_height", "540"); // Height 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci fc->AddSurface(*surface); 29e41f4b71Sopenharmony_ci ``` 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci3. Start and stop previewing. 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci ``` 34e41f4b71Sopenharmony_ci stateCallback->camera_->TriggerLoopingCapture(*fc); // Start previewing. 35e41f4b71Sopenharmony_ci stateCallback->camera_->StopLoopingCapture(); // Stop previewing. 36e41f4b71Sopenharmony_ci ``` 37e41f4b71Sopenharmony_ci 38e41f4b71Sopenharmony_ci 39