本文整理汇总了C++中CFbsBitGc::SetPenColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitGc::SetPenColor方法的具体用法?C++ CFbsBitGc::SetPenColor怎么用?C++ CFbsBitGc::SetPenColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitGc
的用法示例。
在下文中一共展示了CFbsBitGc::SetPenColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: DrawViewFinderErrorL
// ---------------------------------------------------------------------------
// CMMACameraWindow::DrawViewFinderError()
// Draws the error message to specified area.
// Used in cases when viewfinder is unable to start.
// ---------------------------------------------------------------------------
//
void CMMACameraWindow::DrawViewFinderErrorL(
const TInt /*aError*/,
const TRect& aDrawRect)
{
ASSERT(iDirectAccess);
TInt dcError = KErrNone;
if (!iDirectAccess->IsActive())
{
TRAP(dcError, iDirectAccess->StartL());
}
TRect drawRect(aDrawRect);
if (dcError == KErrNone)
{
drawRect.Intersection(iClientRect);
drawRect.Move(-iWindow->AbsPosition());
CFbsBitGc* directGc = iDirectAccess->Gc();
directGc->SetClippingRect(drawRect);
directGc->SetBrushColor(TRgb(128,128,128));
directGc->SetPenColor(TRgb(128,0,0));
directGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
directGc->SetPenStyle(CGraphicsContext::ESolidPen);
directGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
directGc->DrawRect(drawRect);
if (!iErrorIconBitmap || !iErrorIconMaskBitmap)
{
if (iErrorIconBitmap)
{
delete iErrorIconBitmap;
iErrorIconBitmap = NULL;
}
if (iErrorIconMaskBitmap)
{
delete iErrorIconMaskBitmap;
iErrorIconMaskBitmap = NULL;
}
/*
AknsUtils::CreateIconL(
AknsUtils::SkinInstance(),
KAknsIIDQgnIndiCam4Camera,
iErrorIconBitmap,
iErrorIconMaskBitmap,
KCameraAppBitmapFile,
EMbmCameraappQgn_indi_cam4_camera,
EMbmCameraappQgn_indi_cam4_camera_mask
);
*/
}
//TRect iconRect
drawRect.iTl.iX += KErrorIconMargin;
drawRect.iTl.iY += KErrorIconMargin;
drawRect.iBr.iX -= KErrorIconMargin;
drawRect.iBr.iY -= KErrorIconMargin;
if (iErrorIconBitmap->SizeInPixels() != drawRect.Size())
{
AknIconUtils::SetSize(iErrorIconBitmap, drawRect.Size());
AknIconUtils::SetSize(iErrorIconMaskBitmap, drawRect.Size());
}
directGc->BitBltMasked(
drawRect.iTl, iErrorIconBitmap,
TRect(iErrorIconBitmap->SizeInPixels()),
iErrorIconMaskBitmap, EFalse);
iDirectAccess->ScreenDevice()->Update();
}
}
示例3: CreatePopupBitmapL
// ---------------------------------------------------------------------------
// CAknDiscreetPopupDrawer::CreatePopupBitmap
// ---------------------------------------------------------------------------
//
void CAknDiscreetPopupDrawer::CreatePopupBitmapL( const TRect& aRect )
{
delete iPopupBitmap;
iPopupBitmap = NULL;
// create a bitmap to draw to
CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap;
CleanupStack::PushL( bitmap );
bitmap->Create(
aRect.Size(), CCoeEnv::Static()->ScreenDevice()->DisplayMode() );
CFbsBitGc* fbsBitGc = CFbsBitGc::NewL();
CleanupStack::PushL( fbsBitGc );
CFbsBitmapDevice* bmpDevice = CFbsBitmapDevice::NewL( bitmap );
CleanupStack::PushL( bmpDevice );
fbsBitGc->Activate( bmpDevice );
// draw background of the popup
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
AknsDrawUtils::DrawFrame( skin, *fbsBitGc, aRect, aRect,
KAknsIIDQsnFrPopupPreview, KAknsIIDDefault, KAknsDrawParamDefault );
// Draw the texts
TRgb textColor( EikonEnv()->ControlColor( EColorControlText, *iControl ) );
if ( iAction )
{
fbsBitGc->SetUnderlineStyle( EUnderlineOn );
AknsUtils::GetCachedColor( skin,
textColor,
KAknsIIDQsnHighlightColors,
EAknsCIQsnHighlightColorsCG3 );
}
else
{
AknsUtils::GetCachedColor( skin,
textColor,
KAknsIIDQsnTextColors,
EAknsCIQsnTextColorsCG55 );
}
fbsBitGc->SetPenColor( textColor );
DrawTexts( fbsBitGc );
fbsBitGc->SetUnderlineStyle( EUnderlineOff );
// draw the icon
if ( iIcon && iIcon->Bitmap() && iIcon->Mask() )
{
fbsBitGc->BitBltMasked( iIconRect.iTl,
iIcon->Bitmap(),
iIcon->Bitmap()->SizeInPixels(),
iIcon->Mask(),
EFalse );
}
else if( iIcon && iIcon->Bitmap() )
{
fbsBitGc->BitBlt( iIconRect.iTl, iIcon->Bitmap() );
}
CleanupStack::PopAndDestroy( bmpDevice );
CleanupStack::PopAndDestroy( fbsBitGc );
CleanupStack::Pop( bitmap );
iPopupBitmap = bitmap;
}
示例4: DrawItem
// CFepLayoutChoiceList::DrawItem
// Draw a choice list item.
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
void CFepLayoutChoiceList::DrawItem(const TRect& aRect, const CFepLayoutChoiceList::SItem& aItem,
TBool aErase, TBool aFocus)
{
if(iWndControl)
return;
CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
if( aErase )
{
SetBorderColor( BkColor() );
//DrawChoiceListBackground( aRect );//, EFalse);
}
if( aFocus )
{
//draw focus bitmap
TRect rtFocusRect(iItemFocusRect);
TRect rtFocusInBmp(TPoint(0,0), iItemFocusRect.Size());
rtFocusRect.Move(aRect.iTl);
TRect rtInnerRect( rtFocusRect );
rtInnerRect.Shrink( 5, 5 );
if( iSubItemSkinID.iMajor != EAknsMajorNone &&
iSubItemSkinID.iMinor != EAknsMinorNone)
{
gc->Activate( BitmapDevice() );
AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(),
*gc,
rtFocusRect,
rtInnerRect,
iSubItemSkinID,
KAknsIIDDefault );
}
else
{
//mask bitmaps-------
gc->Activate( MaskBitmapDevice() );
if( iItemFocusBmpMask )
{
DrawBitmap(rtFocusRect, rtFocusInBmp, iItemFocusBmpMask,
iItemFocusBmpMask->SizeInPixels() == rtFocusInBmp.Size());
}
//front bitmaps-------
gc->Activate( BitmapDevice() );
if( iItemFocusBmp )
{
DrawBitmap(rtFocusRect, rtFocusInBmp, iItemFocusBmp,
iItemFocusBmp->SizeInPixels() == rtFocusInBmp.Size());
}
}
}
//draw text
if (iFont)
{
gc->UseFont(iFont);
gc->SetBrushStyle( CGraphicsContext::ENullBrush );
gc->SetPenColor(iFontColor);
gc->SetPenStyle(CGraphicsContext::ESolidPen);
gc->DrawText(aItem.iText, aRect, iBaseline, CGraphicsContext::ELeft, iMargin);
gc->DiscardFont();
}
}