author | Dominic Pinkman <dominic.pinkman@nokia.com> |
Fri, 11 Jun 2010 12:39:03 +0100 | |
changeset 8 | ae94777fff8f |
parent 7 | 51a74ef9ed63 |
child 13 | 48780e181b38 |
permissions | -rw-r--r-- |
8
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
1 |
<?xml version="1.0" encoding="utf-8"?> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
2 |
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
3 |
<!-- This component and the accompanying materials are made available under the terms of the License |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
4 |
"Eclipse Public License v1.0" which accompanies this distribution, |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
5 |
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
6 |
<!-- Initial Contributors: |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
7 |
Nokia Corporation - initial contribution. |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
8 |
Contributors: |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
9 |
--> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
10 |
<!DOCTYPE concept |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
11 |
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
12 |
<concept id="GUID-652DA0DD-AB1D-58A4-A6D2-27B5BAA506FF" xml:lang="en"><title>Flipping |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
13 |
and Rotating an External Surface</title><shortdesc>This topic provides an example of flipping and rotating a surface |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
14 |
in order to mirror the camera viewfinder during video telephony. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
15 |
<p> <b>Variant</b>: ScreenPlay. <b>Target audience</b>: Device |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
16 |
creators. </p> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
17 |
<p>When users use the camera at the front of their phone during video telephony, |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
18 |
they expect their image to be mirrored like when they look in a mirror. The |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
19 |
camera viewfinder renders its content to a graphics surface which is displayed |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
20 |
in a window by setting it as the background surface. To mirror the viewfinder |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
21 |
content, first flip the surface and then rotate it by 180°. </p> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
22 |
<fig id="GUID-87C0B943-81DC-5AB8-BD08-254811F511B5"> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
23 |
<title> Mirroring </title> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
24 |
<image href="GUID-7F0EC737-F5EE-5B58-B9EB-4D8A058E3A49_d0e195421_href.jpg" placement="inline"/> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
25 |
</fig> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
26 |
<p>The following example code assumes that the surface already exists. Call <xref href="GUID-59A10068-E37A-37CF-85C9-36D8DA6619FA.dita#GUID-59A10068-E37A-37CF-85C9-36D8DA6619FA/GUID-F42D5405-2144-34AB-B3FE-C1D76C2A3B31"><apiname>TSurfaceConfiguration::SetFlip()</apiname></xref> to |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
27 |
flip the surface, then call <xref href="GUID-59A10068-E37A-37CF-85C9-36D8DA6619FA.dita#GUID-59A10068-E37A-37CF-85C9-36D8DA6619FA/GUID-A7CC9BAA-301D-3006-AAA8-6549B163A448"><apiname>TSurfaceConfiguration::SetOrientation()</apiname></xref> to |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
28 |
rotate the flipped surface by 180°. Finally bind the surface to the window. |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
29 |
If necessary, set attributes such as extent to the surface configuration. </p> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
30 |
<codeblock id="GUID-EE5C2403-E4BC-503B-B49C-1580AA32DA7A" xml:space="preserve">TSurfaceConfiguration config; |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
31 |
RWindow iWindow; |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
32 |
|
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
33 |
// Set the surface ID. |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
34 |
config.SetSurfaceId(iSurfaceId); |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
35 |
|
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
36 |
// Get the window size and set the extent. |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
37 |
const TRect windowSize(iWindow->Size()); |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
38 |
config.SetExtent(windowSize); |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
39 |
|
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
40 |
// Set the flipping |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
41 |
config.SetFlip(ETrue); |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
42 |
|
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
43 |
// Rotate the flipped surface by 180° |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
44 |
config.SetOrientation(CFbsBitGc::EGraphicsOrientationRotated180); |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
45 |
|
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
46 |
// Bind the surface to the window using the configuration |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
47 |
iWindow.SetBackgroundSurface(config, ETrue);</codeblock> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
48 |
</conbody><related-links> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
49 |
<link href="GUID-495EA1C8-E95F-54AE-B4D1-0F463003C2D7.dita"><linktext>External |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
50 |
Surfaces Overview</linktext></link> |
ae94777fff8f
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents:
7
diff
changeset
|
51 |
|
7
51a74ef9ed63
Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff
changeset
|
52 |
</related-links></concept> |