week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-294E84BB-65D0-5275-848E-1960B201A371"><title>Creating and Drawing to an Off-Screen Bitmap</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This topic provides an example that shows the creation of a bitmap, the creation of an off-screen graphics device and graphics context for it, and the use of that graphics context to draw to the bitmap. Once a graphics context has been established for the bitmap, any of the GDI drawing functions can be used on the bitmap, as if it were the more common graphics context—the screen. </p> <codeblock id="GUID-E7A1651B-4F87-5156-9CDE-F8205323DB8E" xml:space="preserve">// Create a bitmap to be used off-screen.
CFbsBitmap* offScreenBitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL(offScreenBitmap);
User::LeaveIfError(offScreenBitmap->Create(TSize(100,100),EColor256));
// Create an off-screen device and context.
CGraphicsContext* bitmapContext=NULL;
CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(offScreenBitmap);
CleanupStack::PushL(bitmapDevice);
User::LeaveIfError(bitmapDevice->CreateContext(bitmapContext));
CleanupStack::PushL(bitmapContext);
// Draw something on the bitmap.
TRect rect(0,0,100,100);
bitmapContext->SetBrushColor(KRgbRed);
bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush);
bitmapContext->DrawRect(rect); // a filled red rectangle
// Now do what you want with it, such as blitting to the screen.
gc.BitBlt(TPoint(20,20),offScreenBitmap);
// Cleanup.
CleanupStack::PopAndDestroy(3);
...</codeblock> </conbody><related-links><link href="GUID-AFE8A9CC-E026-5396-8E0C-616338B5F5C3.dita"><linktext>BitGDI Tutorials</linktext> </link> <link href="GUID-EAAD1719-C02C-5705-A5C3-993E36441BE6.dita"><linktext>BitGDI Component</linktext> </link> </related-links></concept>