Symbian3/SDK/Source/GUID-A3EBB297-1494-579C-83D5-8FDBBD01B674.dita
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
equal deleted inserted replaced
7:51a74ef9ed63 8:ae94777fff8f
    17 TSize bmpPieceSize(bmpSizeInPixels.iWidth/2,bmpSizeInPixels.iHeight/2);
    17 TSize bmpPieceSize(bmpSizeInPixels.iWidth/2,bmpSizeInPixels.iHeight/2);
    18 TRect bmpPieceRect(TPoint(0,0),bmpPieceSize); 
    18 TRect bmpPieceRect(TPoint(0,0),bmpPieceSize); 
    19     
    19     
    20 // blit only the piece of the bitmap indicated by bmpPieceRect
    20 // blit only the piece of the bitmap indicated by bmpPieceRect
    21 TPoint pos(100,100);
    21 TPoint pos(100,100);
    22 gc.BitBlt(pos, bitmap, bmpPieceRect);</codeblock> </section> <section id="GUID-22430013-D8A8-5A09-8DD9-D95A6EF00B2D"><title>Masked bitmap block transfer</title> <p>Masks can be used to select which parts of a bitmap are drawn by <codeph>CBitmapContext::BitBltMasked()</codeph>. </p> <p>Masks can be used to not display pixels of the source bitmap if their corresponding mask pixel is black, or, alternatively, where the mask is white (called an inverted mask). </p> <p>The following figure shows successively a source bitmap, a mask, and the outcome when they are blitted with <codeph>BitBltMasked()</codeph>. </p> <fig id="GUID-425B6A42-6B3B-5FE4-BDD6-59CD7E695C4A"><image href="GUID-D1E80B1B-FBFD-5FBC-981C-E2D04A02EF41_d0e208830_href.png" placement="inline"/></fig> <codeblock id="GUID-8D967F91-A768-5DA7-A7D7-D5CA2D40B8D9" xml:space="preserve">// Load the mask bitmap, just like any other
    22 gc.BitBlt(pos, bitmap, bmpPieceRect);</codeblock> </section> <section id="GUID-22430013-D8A8-5A09-8DD9-D95A6EF00B2D"><title>Masked bitmap block transfer</title> <p>Masks can be used to select which parts of a bitmap are drawn by <codeph>CBitmapContext::BitBltMasked()</codeph>. </p> <p>Masks can be used to not display pixels of the source bitmap if their corresponding mask pixel is black, or, alternatively, where the mask is white (called an inverted mask). </p> <p>The following figure shows successively a source bitmap, a mask, and the outcome when they are blitted with <codeph>BitBltMasked()</codeph>. </p> <fig id="GUID-425B6A42-6B3B-5FE4-BDD6-59CD7E695C4A"><image href="GUID-D1E80B1B-FBFD-5FBC-981C-E2D04A02EF41_d0e203822_href.png" placement="inline"/></fig> <codeblock id="GUID-8D967F91-A768-5DA7-A7D7-D5CA2D40B8D9" xml:space="preserve">// Load the mask bitmap, just like any other
    23 CFbsBitmap* maskBitmap = new (ELeave) CFbsBitmap();
    23 CFbsBitmap* maskBitmap = new (ELeave) CFbsBitmap();
    24 CleanupStack::PushL(maskBitmap);
    24 CleanupStack::PushL(maskBitmap);
    25 User::LeaveIfError(maskBitmap-&gt;
    25 User::LeaveIfError(maskBitmap-&gt;
    26   Load(multiBitmapFile,EMbmGrbmap2Smilmask));
    26   Load(multiBitmapFile,EMbmGrbmap2Smilmask));
    27     
    27