本文整理汇总了C++中CFbsBitmapDevice::CreateBitmapContext方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitmapDevice::CreateBitmapContext方法的具体用法?C++ CFbsBitmapDevice::CreateBitmapContext怎么用?C++ CFbsBitmapDevice::CreateBitmapContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitmapDevice
的用法示例。
在下文中一共展示了CFbsBitmapDevice::CreateBitmapContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadPicture
void CSliderControl::LoadPicture()
{
CFbsBitmap* BitMap = new (ELeave) CFbsBitmap();
BitMap->Create(Size(),EColor16M);
CAknsBasicBackgroundControlContext* iContext =
CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain,Rect(),ETrue);
CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(BitMap);
CBitmapContext* bitGc = NULL;
bitmapDevice->CreateBitmapContext(bitGc);
///
CleanupStack::PushL(iContext);
CleanupStack::PushL(bitmapDevice);
CleanupStack::PushL(bitGc);
AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(),iContext,NULL,*bitGc,TPoint(0,0),Rect(),0);
CleanupStack::PopAndDestroy(3);
iIcon=BitMap;
/*
CFbsBitmap* mask;
CFbsBitmap* icon;
_LIT(KPath,"\\resource\\apps\\TweakS_ui.mif");
AknIconUtils::CreateIconL(icon,mask,KPath,EMbmTweaks_uiButton_dlg_bg,EMbmTweaks_uiButton_dlg_bg_mask);
AknIconUtils::SetSize(icon,Size(),EAspectRatioNotPreserved);
AknIconUtils::SetSize(mask,Size(),EAspectRatioNotPreserved);
iIcon=CGulIcon::NewL(icon,mask);
*/
}
示例2: bitmap
void tst_NativeImageHandleProvider::bitmap()
{
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
QPixmap tmp(10, 20);
if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) {
BitmapProvider prov;
// This should fail because of null ptr.
QPixmap pm = pixmapFromNativeImageHandleProvider(&prov);
QVERIFY(pm.isNull());
pm = QPixmap();
QCOMPARE(prov.refCount, 0);
prov.bmp = new CFbsBitmap;
QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone);
CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(prov.bmp);
CBitmapContext *bitmapContext = 0;
QCOMPARE(bitmapDevice->CreateBitmapContext(bitmapContext), KErrNone);
TRgb symbianColor = TRgb(255, 200, 100);
bitmapContext->SetBrushColor(symbianColor);
bitmapContext->Clear();
delete bitmapContext;
delete bitmapDevice;
pm = pixmapFromNativeImageHandleProvider(&prov);
QVERIFY(!pm.isNull());
QCOMPARE(pm.width(), prov.w);
QCOMPARE(pm.height(), prov.h);
QVERIFY(prov.refCount == 1);
QImage img = pm.toImage();
QVERIFY(prov.refCount == 1);
QRgb pix = img.pixel(QPoint(1, 2));
QCOMPARE(qRed(pix), symbianColor.Red());
QCOMPARE(qGreen(pix), symbianColor.Green());
QCOMPARE(qBlue(pix), symbianColor.Blue());
pm = QPixmap(); // should result in calling release
QCOMPARE(prov.refCount, 0);
delete prov.bmp;
} else {
QSKIP("Not openvg", SkipSingle);
}
#else
QSKIP("Not applicable", SkipSingle);
#endif
}