本文整理汇总了C++中CFbsBitGc::SetPenSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitGc::SetPenSize方法的具体用法?C++ CFbsBitGc::SetPenSize怎么用?C++ CFbsBitGc::SetPenSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitGc
的用法示例。
在下文中一共展示了CFbsBitGc::SetPenSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: End
/**
Completes a pass of this render stage.
*/
void CTestRenderStage::End()
{
CFbsBitGc* gc = iBackBuffer->GetBitGcCurrent();
gc->SetPenSize(TSize(2,2));
gc->SetPenColor(KRgbRed);
gc->DrawLine(TPoint(50,0),TPoint(0,50));
gc->SetPenColor(KRgbGreen);
gc->DrawLine(TPoint(60,0),TPoint(0,60));
if (Next())
{
gc = Next()->Begin();
const TRegion* region = iScreenRedraw->AnimationRegion();
if(region && !region->IsEmpty() && !region->CheckError())
{
if (iBackBuffer->Observer())
iBackBuffer->Observer()->BeforeUpdate(*iBackBuffer,*region);
gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc->SetClippingRegion(region);
gc->BitBlt(-iScreenConfig->ScaledOrigin(),iBackBuffer->GetBitmap());
gc->SetDrawMode(CGraphicsContext::EDrawModePEN);
gc->CancelClipping();
if (iBackBuffer->Observer())
iBackBuffer->Observer()->AfterUpdate(*iBackBuffer,*region);
}
Next()->End();
}
}
示例2: DrawL
void CTSpriteAnim::DrawL(TInt aOpcode)
{
CFbsBitmap *bitmap=iSpriteFunctions->GetSpriteMember(0)->iBitmap;
CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(bitmap);
CleanupStack::PushL(device);
CFbsBitGc *gc;
User::LeaveIfError(device->CreateContext(gc));
CleanupStack::PushL(gc);
gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
gc->SetPenSize(TSize());
TSize bitmapSize=bitmap->SizeInPixels();
TSize size= bitmapSize;
size.SetSize(size.iWidth/2,size.iHeight/2);
TPoint point=size.AsPoint();
// according to the opcode used, a quarter of the sprite bitmap is drawn to a different colour
switch(aOpcode)
{
case EADllDraw1:
{
gc->SetBrushColor(TRgb(255,0,0));
gc->DrawRect(TRect(TPoint(),size));
break;
}
case EADllDraw2:
{
gc->SetBrushColor(TRgb(0,255,0));
gc->DrawRect(TRect(TPoint(point.iX,0),size));
break;
}
case EADllDraw3:
{
gc->SetBrushColor(TRgb(0,0,255));
gc->DrawRect(TRect(TPoint(0,point.iY),size));
break;
}
case EADllDrawBlank:
{//the whole sprite bitmap is set to blank
gc->SetBrushColor(TRgb(255,255,255));
gc->DrawRect(TRect(TPoint(),bitmapSize));
break;
}
default:;
}
iSpriteFunctions->UpdateMember(0,TRect(bitmap->SizeInPixels()),ETrue);
CleanupStack::PopAndDestroy(2); //gc and device
}