当前位置: 首页>>代码示例>>C++>>正文


C++ CWindowGc::BitBltMasked方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:29,代码来源:LAFMENUP.CPP

示例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);
  		}
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:31,代码来源:cwu_welcomeviews.cpp

示例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);
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:45,代码来源:LAFMENUP.CPP


注:本文中的CWindowGc::BitBltMasked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。