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