Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Series 60 3rd上绘图时设置字体的大小

From Wiki
Jump to: navigation, search
Article Metadata

beover1984 在 02 Aug 2007 创建
最后由 hamishwillee 在 15 Dec 2011 编辑


void  CEditorList3Col::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
iCoeEnv->ScreenDevice()->ReleaseFont( font );

说明: 由于Series60 3rd上与2nd上使用的字体形式可能不同,上面的代码可能在Series60 2nd上没有效果.

This page was last modified on 15 December 2011, at 10:13.
122 page views in the last 30 days.