本文整理汇总了C++中CFbsBitGc::DrawText方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitGc::DrawText方法的具体用法?C++ CFbsBitGc::DrawText怎么用?C++ CFbsBitGc::DrawText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitGc
的用法示例。
在下文中一共展示了CFbsBitGc::DrawText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RasterizeLineL
EXPORT_C void THuiFont::RasterizeLineL(const TDesC& aTextString, CFbsBitGc& aTargetContext)
{
// Retrieve the CFont object used when rasterizing this text mesh.
CFont* font = NearestFontL();
// Draw the text
aTargetContext.UseFont(font);
TInt avkonMaxAscent = 0;
if (CCoeEnv::Static())
{
const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( font );
avkonMaxAscent = layoutFont->MaxAscent() + KHuiFontVerticalShiftInPixels;
}
else
{
avkonMaxAscent = iTextPaneHeight;
}
aTargetContext.DrawText(aTextString, TPoint(0, avkonMaxAscent ));
aTargetContext.DiscardFont();
}
示例2: 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();
}
}