本文整理汇总了C++中CWindowGc::BitBltMasked方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::BitBltMasked方法的具体用法?C++ CWindowGc::BitBltMasked怎么用?C++ CWindowGc::BitBltMasked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWindowGc
的用法示例。
在下文中一共展示了CWindowGc::BitBltMasked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawIcon
/**
* Draws the icon for the item to the graphics context aGc, in the middle of the rectangle aRect
*/
EXPORT_C void LafMenuPaneItem::DrawIcon(const MLafEnv& /*aLafEnv*/, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const CGulIcon* aIcon, SLafMenuPane::THighlightType aHighlightType)
{
if (aIcon)
{
if (aHighlightType == SLafMenuPane::EDrawHighlight)
aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
// Determine the rect available for the bitmap
TRect rect = aRect;
// put the image in the middle of available rect
const CFbsBitmap* bitmap = aIcon->Bitmap();
const TSize bmpSize(bitmap->SizeInPixels());
const TSize rectSize(aRect.Size());
const TPoint offset(((rectSize.iWidth - bmpSize.iWidth) / 2), ((rectSize.iHeight - bmpSize.iHeight) / 2));
const CFbsBitmap* mask = aIcon->Mask();
if (mask)
{
const TRect bmpRect(0, 0, bmpSize.iWidth, bmpSize.iHeight);
aGc.BitBltMasked(rect.iTl+offset, bitmap, bmpRect, mask, ETrue);
}
else
aGc.BitBlt(rect.iTl+offset, bitmap);
if (aHighlightType == SLafMenuPane::EDrawHighlight)
aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
}
}
示例2: DrawIconL
static void DrawIconL(CWindowGc& aGc, CGulIcon& aIcon, const TJuikLayoutItem& aL, TBool aDoCenter=ETrue)
{
CALLSTACKITEMSTATIC_N(_CL(""), _CL("DrawIconL"));
CFbsBitmap* bmp = aIcon.Bitmap();
CFbsBitmap* mask = aIcon.Mask();
aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
// center
TInt bmpW = bmp->SizeInPixels().iWidth;
TInt areaW = aL.Size().iWidth;
TInt dx = 0;
TInt dy = 0;
if ( aDoCenter && bmpW < areaW )
{
dx = (areaW - bmpW) / 2;
}
TPoint tl = aL.TopLeft();
tl += TPoint(dx,dy);
TRect r(TPoint(0,0), bmp->SizeInPixels());
if ( mask )
{
aGc.BitBltMasked( tl, bmp, r, mask, ETrue);
}
else
{
aGc.BitBlt( tl, bmp, r);
}
}
示例3: DrawLeftAdornment
/**
* Draws the left adornment to the graphics context aGc, in the rectangle aRect. The menu pane
* flags determines the type of adornment to be drawn.
*/
EXPORT_C void LafMenuPane::DrawLeftAdornment(const MLafEnv& aLafEnv, const CCoeControl& /*aMenuPane*/, CWindowGc& aGc, const TRect& aRect, const TItemAttributes& aItemAttributes)
{
// Brush the background of the rect.
aGc.SetPenStyle(CGraphicsContext::ENullPen);
aGc.DrawRect(aRect);
aGc.SetPenStyle(CGraphicsContext::ESolidPen);
const TInt itemFlags = aItemAttributes.iFlags;
if (itemFlags&EEikMenuItemSymbolOn)
{
if (itemFlags&EEikMenuItemCheckBox)
{
TRect rect = aRect;
rect.iTl.iY += aItemAttributes.iBaseLine;
TBuf<1> buf;
buf.Append(TChar(ESymFontTick));
aGc.UseFont(SymbolFont(aLafEnv));
aGc.SetPenStyle(CGraphicsContext::ESolidPen);
// as the tick is big, ignore KPreLeftAdornment and steal 1 pixels from left.
aGc.DrawText(buf,TPoint(rect.iTl.iX-1, rect.iTl.iY));
aGc.UseFont(NormalFont(aLafEnv));
}
else if (itemFlags&KLafMenuItemRadio)
{
TUid bmpUid(TUid::Uid(KLafUidEikonOptiVal));
const CFbsBitmap* bitmap = aLafEnv.Bitmap(bmpUid);
TSize bitsize = bitmap->SizeInPixels();
TRect butRect(TPoint(0,0), TPoint(bitsize.iWidth,bitsize.iHeight));
TInt yoffset = (aRect.Size().iHeight - bitsize.iHeight) / 2;
TInt xoffset = KLafPreLeftAdornmentSpace;
TPoint offset(xoffset,yoffset);
if (aItemAttributes.iHighlightType == SLafMenuPane::EDrawHighlight)
{
bmpUid=TUid::Uid(KLafUidEikonOptihVal);
bitmap = aLafEnv.Bitmap(bmpUid);
}
bmpUid=TUid::Uid(KLafUidEikonOptimVal);
const CFbsBitmap* mask = aLafEnv.Bitmap(bmpUid);
aGc.BitBltMasked((aRect.iTl+offset), bitmap, butRect, mask,ETrue);
}
}
}