本文整理汇总了C++中CWindowGc::DrawWsGraphic方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::DrawWsGraphic方法的具体用法?C++ CWindowGc::DrawWsGraphic怎么用?C++ CWindowGc::DrawWsGraphic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWindowGc
的用法示例。
在下文中一共展示了CWindowGc::DrawWsGraphic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoTestDrawGraphicCompareL
void CWsGraphicShareBase::DoTestDrawGraphicCompareL(TPtrC aShare)
{
// UID of the shared graphic
TUid uid1 = {0x12000021};
TWsGraphicId twsGraphicId1(uid1);
_LIT8(KTestData,"HelloWorld");
CFbsBitmap bitmap1;
CFbsBitmap mask1;
TSize screenSize = iScreen->SizeInPixels();
User::LeaveIfError(bitmap1.Load(MY_TEST_BITMAP,0));
mask1.Create(bitmap1.SizeInPixels(),iScreen->DisplayMode());
CWsGraphicBitmap* bTest = CWsGraphicBitmap::NewL(&bitmap1,&mask1);
// divide the screen into two equal rectangles
TRect position1(0,0,screenSize.iWidth/2,screenSize.iHeight);
TRect position2(screenSize.iWidth/2,0,screenSize.iWidth,screenSize.iHeight);
// draw the new graphic and attempt to draw the shared graphic
iGc->Activate(*iWin);
iWin->Invalidate();
iWin->BeginRedraw();
iGc->Clear(position1);
iGc->Clear(position2);
iGc->DrawWsGraphic(bTest->Id(),position1,KTestData);
iGc->DrawWsGraphic(twsGraphicId1.Uid(),position2,KTestData);
iGc->Deactivate();
iWin->EndRedraw();
iWs.Flush();
iWs.Finish();
// compare the graphic in both positions
if (aShare==_L("false"))
Test(!iScreen->RectCompare(position1,position2));
else
Test(iScreen->RectCompare(position1,position2));
delete bTest;
}