Symbian 截图如何保存?
CWsScreenDevice* ScreenDevice=CCoeEnv::Static()->ScreenDevice();CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
CleanupStack::PushL( bitmap );
User::LeaveIfError(bitmap->Create(ScreenDevice->SizeInPixels(),ScreenDevice->DisplayMode()));
User::LeaveIfError( ScreenDevice->CopyScreenToBitmap(bitmap));
TInt bb=bitmap->ScanLineLength(240,ScreenDevice->DisplayMode());
/*****************可以加一些处理bitmap的程序,如保存********************/
TFileName fnDataFile;
fnDataFile.Copy(_L("c:\\Data\\FileExam.bmp"));
RFs &fs=CCoeEnv::Static()->FsSession();
RFile file;
User::LeaveIfError(file.Create(fs,fnDataFile,EFileWrite|EFileWrite));
TInt h=bitmap->Save(file);
CleanupStack::PopAndDestroy(bitmap);
这个保存之后,文件有数据,但是没发显示,想是因为--要编码格式,但是不知怎么弄?网上的资料都是Copy,所以请哪位大侠帮帮忙,必将感激涕零! --------------------编程问答-------------------- 保存的是mbm数据格式的,所以看不了。
楼主可以参考一下CImageEncoder或者CMdaImageBitmapToFileUtility --------------------编程问答-------------------- 保存好的格式是.mbm,格式
补充:移动开发 , Symbian