Symbian3/PDK/Source/GUID-02BD38E7-A579-5BD5-9444-4E7C14C7809A.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 9 59758314f811
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
    20 <p> <i>Note</i>: Semi-transparent UI content over content provided by Direct
    20 <p> <i>Note</i>: Semi-transparent UI content over content provided by Direct
    21 Screen Access (DSA) has never been supported and ScreenPlay does not change
    21 Screen Access (DSA) has never been supported and ScreenPlay does not change
    22 this. </p>
    22 this. </p>
    23 <p> <b>Variant</b>: ScreenPlay and non-ScreenPlay. <b>Target audience</b>:
    23 <p> <b>Variant</b>: ScreenPlay and non-ScreenPlay. <b>Target audience</b>:
    24 Application developers. </p>
    24 Application developers. </p>
    25 <section><title>Alpha compositing</title> <p>In alpha compositing, an alpha
    25 <section id="GUID-7208D287-D0D9-4E19-89F0-87DB9BCE4736"><title>Alpha compositing</title> <p>In alpha compositing, an alpha
    26 channel is used to store opacity information along with the color values for
    26 channel is used to store opacity information along with the color values for
    27 each pixel. For example, if the color is represented as RGB values, the pixel
    27 each pixel. For example, if the color is represented as RGB values, the pixel
    28 values are typically stored as RGBA, where the final value is the alpha value.
    28 values are typically stored as RGBA, where the final value is the alpha value.
    29 This represents the percentage opacity. Like the RGB values, the alpha value
    29 This represents the percentage opacity. Like the RGB values, the alpha value
    30 is frequently expressed in the range of 0 (completely transparent) to 255
    30 is frequently expressed in the range of 0 (completely transparent) to 255
    34 of the pixel. In order to reduce the need for multiplication during the compositing
    34 of the pixel. In order to reduce the need for multiplication during the compositing
    35 process, the RGB values are sometimes multiplied by the alpha value before
    35 process, the RGB values are sometimes multiplied by the alpha value before
    36 storage. This is known as <b>premultiplied alpha</b> format. For example,
    36 storage. This is known as <b>premultiplied alpha</b> format. For example,
    37 a premultiplied alpha representation of white that has 50% opacity is (127,
    37 a premultiplied alpha representation of white that has 50% opacity is (127,
    38 127, 127, 127). </p> </section>
    38 127, 127, 127). </p> </section>
    39 <section><title>Enabling transparency</title> <p>To enable transparency, call
    39 <section id="GUID-ED7D01C9-6B18-4280-B44E-B62ADE9EBA90"><title>Enabling transparency</title> <p>To enable transparency, call
    40 the <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow::SetTransparencyAlphaChannel()</apiname></xref> method
    40 the <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow::SetTransparencyAlphaChannel()</apiname></xref> method
    41 on the window (which must be an <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow</apiname></xref> type)
    41 on the window (which must be an <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow</apiname></xref> type)
    42 before it is activated. The transparency is then determined by the alpha values
    42 before it is activated. The transparency is then determined by the alpha values
    43 of the content rendered to the window. Typically you set the background to
    43 of the content rendered to the window. Typically you set the background to
    44 be fully or partially transparent, as shown in the following example: </p> <codeblock id="GUID-C33B91C2-D83C-5A6D-91A5-AB29B8EF46A0" xml:space="preserve">// Set transparency mode on.
    44 be fully or partially transparent, as shown in the following example: </p> <codeblock id="GUID-C33B91C2-D83C-5A6D-91A5-AB29B8EF46A0" xml:space="preserve">// Set transparency mode on.
    50 // Activate the window.
    50 // Activate the window.
    51 iWindow.Activate();
    51 iWindow.Activate();
    52     
    52     
    53 // Begin drawing to the window.
    53 // Begin drawing to the window.
    54 ...  </codeblock></section>
    54 ...  </codeblock></section>
    55 <section><title>Note</title><p>In earlier versions of the Symbian
    55 <section id="GUID-66EBABCC-4BF4-4DE8-9AD3-27598F3A0025"><title>Note</title><p>In earlier versions of the Symbian platform,
    56 platform, it was possible to create transparent windows using a mask and the <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow</apiname></xref> class's <codeph>SetTransparencyFactor()</codeph>, <codeph>SetTransparencyBitmap()</codeph> and <codeph>SetTransparencyWsBitmap()</codeph> methods. <b>This mechanism is now deprecated and these methods are no longer
    56 it was possible to create transparent windows using a mask and the <xref href="GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.dita"><apiname>RWindow</apiname></xref> class's <codeph>SetTransparencyFactor()</codeph>, <codeph>SetTransparencyBitmap()</codeph> and <codeph>SetTransparencyWsBitmap()</codeph> methods. <b>This
    57 functional</b>.</p><p>A new application and UI framework is planned for Symbian^4
    57 mechanism is now deprecated and these methods are no longer functional</b>.</p><p>A
    58 (S^4). In order for AVKON applications (and clients that draw using <xref href="GUID-5FAF3401-9EC6-3411-9AB3-BBDB4A448C65.dita"><apiname>CWindowGC</apiname></xref>)
    58 new application and UI framework is planned for Symbian^4 (S^4). In order
       
    59 for AVKON applications (and clients that draw using <xref href="GUID-0AEE5955-C530-35F1-A904-69183331B294.dita"><apiname>CWindowGc</apiname></xref>)
    59 to work correctly on this new framework, the main view must be opaque. See <xref href="GUID-29272C8D-A0F6-4861-90FB-D1637D0D8CD8.dita">How will the New Application
    60 to work correctly on this new framework, the main view must be opaque. See <xref href="GUID-29272C8D-A0F6-4861-90FB-D1637D0D8CD8.dita">How will the New Application
    60 Architecture Affect my Applications?</xref> for more information.</p> </section>
    61 Architecture Affect my Applications?</xref> for more information.</p> </section>
    61 </conbody><related-links>
    62 </conbody><related-links>
    62 <link href="GUID-99AE1D62-571A-5A63-B472-C0FBC0861F52.dita"><linktext>Window Types</linktext>
    63 <link href="GUID-99AE1D62-571A-5A63-B472-C0FBC0861F52.dita"><linktext>Window Types</linktext>
    63 </link>
    64 </link>