diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF.dita --- a/Symbian3/SDK/Source/GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,52 +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 - + + + + + +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