symbian下如何截圖

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.libws32.lib 兩個庫。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章