diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,52 @@ + + + + + +Flipping +and Rotating an External SurfaceThis topic provides an example of flipping and rotating a surface +in order to mirror the camera viewfinder during video telephony. +

Variant: ScreenPlay. Target audience: Device +creators.

+

When users use the camera at the front of their phone during video telephony, +they expect their image to be mirrored like when they look in a mirror. The +camera viewfinder renders its content to a graphics surface which is displayed +in a window by setting it as the background surface. To mirror the viewfinder +content, first flip the surface and then rotate it by 180°.

+ + Mirroring + + +

The following example code assumes that the surface already exists. Call TSurfaceConfiguration::SetFlip() to +flip the surface, then call TSurfaceConfiguration::SetOrientation() to +rotate the flipped surface by 180°. Finally bind the surface to the window. +If necessary, set attributes such as extent to the surface configuration.

+TSurfaceConfiguration config; +RWindow iWindow; + +// Set the surface ID. +config.SetSurfaceId(iSurfaceId); + +// Get the window size and set the extent. +const TRect windowSize(iWindow->Size()); +config.SetExtent(windowSize); + +// Set the flipping +config.SetFlip(ETrue); + +// Rotate the flipped surface by 180° +config.SetOrientation(CFbsBitGc::EGraphicsOrientationRotated180); + +// Bind the surface to the window using the configuration +iWindow.SetBackgroundSurface(config, ETrue); +
+External +Surfaces Overview + +
\ No newline at end of file