Series 60 3rd上绘图时设置字体的大小
FROM: http://blog.csdn.net/Beover1984/archive/2007/08/02/1722513.aspx通常我们在绘制文字时都是使用CEikonEnv提供的NormalFont(),AnnotationFont(),TitleFont()等字体,有的情况需要调整字体的大小,下面的代码演示了如何设置字体大小的方法:
voidCEditorList3Col::Draw(const TRect& aRect) const{ CWindowGc& gc = SystemGc();gc.Clear( aRect ); CFont *font = NULL; //获取字体信息 TFontSpec fontSpec = iEikonEnv->LegendFont()->FontSpecInTwips();fontSpec.iHeight-= fontSpec.iHeight / 6; //更改字体大小 iCoeEnv->ScreenDevice()->GetNearestFontInTwips( font, fontSpec );//根据设置的字体信息获取合适的字体 gc.UseFont( font );//Draw text operation..................................gc.DiscardFont(); iCoeEnv->ScreenDevice()->ReleaseFont( font );//记住要调用ReleaseFont()释放字体资源.}
说明:
由于Series60 3rd上与2nd上使用的字体形式可能不同,上面的代码可能在Series60 2nd上没有效果.
页:
[1]