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


C++ CFbsBitGc::DrawText方法代码示例

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

示例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();
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:72,代码来源:peninputlayoutchoicelist.cpp


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