本文整理汇总了C++中CFbsBitmapDevice::Resize方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitmapDevice::Resize方法的具体用法?C++ CFbsBitmapDevice::Resize怎么用?C++ CFbsBitmapDevice::Resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitmapDevice
的用法示例。
在下文中一共展示了CFbsBitmapDevice::Resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateColorIconLC
EXPORT_C void AknsUtils::CreateColorIconLC(
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
const TAknsItemID& aColorID, const TInt aColorIndex,
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
const TDesC& aFilename,
const TInt aFileBitmapId, const TInt aFileMaskId,
const TRgb aDefaultColor,
const TSize& aSize, const TScaleMode aScaleMode )
{
CFbsBitmap* bitmap = NULL;
CFbsBitmap* mask = NULL;
CreateIconLC( aInstance, aID, bitmap, mask,
aFilename, aFileBitmapId, aFileMaskId ); // (2)
TRgb color = aDefaultColor;
// Return value intentionally ignored
GetCachedColor( aInstance, color, aColorID, aColorIndex );
if( AknIconUtils::IsMifIcon( bitmap ) )
{
AknIconUtils::SetIconColor( bitmap, color );
aBitmap = bitmap;
aMask = mask;
}
else // Create Own Icon
{
CFbsBitmap* colorBitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL( colorBitmap ); // (3)
TSize size = mask->SizeInPixels();
User::LeaveIfError(
colorBitmap->Create( size,
CEikonEnv::Static()->ScreenDevice()->DisplayMode() ) );
CFbsBitmapDevice* colorBmpDev = CFbsBitmapDevice::NewL( colorBitmap );
CleanupStack::PushL( colorBmpDev ); // (4)
User::LeaveIfError( colorBmpDev->Resize( size ) );
CFbsBitGc* colorBmpGc = CFbsBitGc::NewL();
CleanupStack::PushL( colorBmpGc ); // (5)
colorBmpGc->Activate( colorBmpDev );
colorBmpGc->SetBrushColor( color );
colorBmpGc->SetPenStyle( CGraphicsContext::ENullPen );
colorBmpGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
colorBmpGc->DrawRect( TRect( TPoint(0,0), size ) );
CleanupStack::PopAndDestroy( 2 ); // colorBmpGc, colorBmpDev (3)
CleanupStack::Pop( 3 ); // colorBmp, bitmap, mask (0)
delete bitmap; // We don't know the order, must destroy manually
aBitmap = colorBitmap;
aMask = mask;
// These are both safe
CleanupStack::PushL( aBitmap ); // (1)
CleanupStack::PushL( aMask ); // (2)
}
if( aSize.iWidth>=0 )
{
// Set the size
User::LeaveIfError(
AknIconUtils::SetSize( aBitmap, aSize, aScaleMode ) );
}
}