本文整理汇总了C++中CWindowGc::BitBlt方法的典型用法代码示例。如果您正苦于以下问题:C++ CWindowGc::BitBlt方法的具体用法?C++ CWindowGc::BitBlt怎么用?C++ CWindowGc::BitBlt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWindowGc
的用法示例。
在下文中一共展示了CWindowGc::BitBlt方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawAliens
void CSpaceInvadersAppView::DrawAliens(CWindowGc& aGc) const
{
for ( TInt i = 0 ; i < iTotalAliens ; i++ )
{
if ( iAlienArray[i] )
{
TPoint shipPoint(iAlienArray[i]->X(), iAlienArray[i]->Y());
CFbsBitmap* iBitmapShip;
if ( i < 6 )
{
iBitmapShip = iBitmapAlien1;
}
else if ( i < 12 )
{
iBitmapShip = iBitmapAlien2;
}
else
{
iBitmapShip = iBitmapAlien3;
}
aGc.BitBlt( shipPoint, iBitmapShip );
if ( iAlienArray[i]->HasFired() )
{
TPoint shotPoint(iAlienArray[i]->Shot()->X(),
iAlienArray[i]->Shot()->Y());
aGc.BitBlt( shotPoint, iBitmapShot );
}
}
}
}
示例2: DrawShip
void CSpaceInvadersAppView::DrawShip(CWindowGc& aGc) const
{
// Draw the image in the desired position
TPoint shipPoint(iShip->X(), iShip->Y());
aGc.BitBlt( shipPoint, iBitmapShip);
if ( iShip->HasFired() )
{
TPoint shotPoint(iShip->Shot()->X(), iShip->Shot()->Y());
aGc.BitBlt( shotPoint, iBitmapShot );
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: Draw
//Background drawing function
void CTestRectGc::Draw(CWindowGc& aGc, const CCoeControl& aControl, const TRect& aRect) const
{
if (iBmpBackground)
{
TPoint a = PositionRelativeToScreen();
TPoint b = aControl.PositionRelativeToScreen();
//The source rect of the background is the relationship between this control and the control being drawn (child)
//plus the subrect (aRect) to be drawn.
TRect SourceRect(b-a+aRect.iTl, aRect.Size());
aGc.SetDrawMode(CGraphicsContext::EDrawModePEN);
aGc.BitBlt(aRect.iTl, iBmpBackground, SourceRect);
aGc.SetDrawMode(CGraphicsContext::EDrawModePEN);
}
else
{
TRect rc;
aGc.SetClippingRect(aRect);
aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
aGc.SetBrushColor(iBrushColor);
aGc.SetBrushStyle(iBrushStyle);
aGc.DrawRect(rc);
aGc.CancelClippingRect();
}
}
示例6: Draw
void CCustomControlScroll::Draw(CWindowGc& gc)
{
TInt x, y;
//上图标
x = iDisplayPoint.iX;
y = iDisplayPoint.iY;
if (iBitmapDirection[0])
gc.BitBlt(TPoint(x, y), iBitmapDirection[0]);
//下图标
y += iDisplaySize.iHeight-iBitmapHeight;
if (iBitmapDirection[1])
gc.BitBlt(TPoint(x, y), iBitmapDirection[1]);
//滚动条
y = iDisplayPoint.iY+iScrollerPosY;
if (iBitmapScroller)
gc.BitBlt(TPoint(x, y), iBitmapScroller);
}
示例7: DrawImage
void CRhodesAppView::DrawImage(CWindowGc& aGc,
const TRect& aRect) const
{
TSize bmpSizeInPixels( iBitmap->SizeInPixels() );
TInt xDelta = (aRect.Width() - bmpSizeInPixels.iWidth) / 2;
TInt yDelta = (aRect.Height() - bmpSizeInPixels.iHeight) / 2;
TPoint pos( xDelta, yDelta ); // displacement vector
pos += aRect.iTl; // bitmap top left corner position
// Drawing viewfinder image to bitmap
iFbsBitGc->BitBlt( pos, iBitmap, TRect( TPoint( 0, 0 ), bmpSizeInPixels ));
// Draws bitmap with indicators on the screen
TSize size( iOffScreenBitmap->SizeInPixels() );
aGc.BitBlt( TPoint(0,0), iOffScreenBitmap, TRect( TPoint(0,0), size ) );
}
示例8: BlitTo
void CSurface::BlitTo(CWindowGc& aDest, TInt aX, TInt aY)
{
aDest.BitBlt(TPoint(aX,aY), iBitmap);
return;
}