How to capture screen to bitmap
symbian下如何截圖
From Forum Nokia Wiki
來自 Nokia論壇 Wiki
Capturing screen to in-memory bitmap is extremely easy. All you need is to create a bitmap instance with appropriate size
截圖到一個內存裏面的位圖非常的監督,你只需要創建一個適當大小的位圖實例。
CWsScreenDevice* screenDev = CCoeEnv::Static()->ScreenDevice();
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
CleanupStack::PushL( bitmap );
User::LeaveIfError( bitmap->Create( screenDev->SizeInPixels(),
screenDev->DisplayMode() ) );
and then copy screen content into it as follows
然後像下面這樣,將屏幕內容拷貝到它裏面。
User::LeaveIfError( screenDev->CopyScreenToBitmap( bitmap ) );
// use bitmap as appropriate, for example save it to file
CleanupStack::PopAndDestroy( bitmap );
This code links against fbscli.lib and ws32.lib
這些代碼需要鏈接fbscli.lib 和ws32.lib 兩個庫。