逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::
在一个Rect的正中间绘制文本: rect的中点与文本的中点重合.
int cx = rect.x + rect.width / 2;
int fx = cx - fm.width(text);

int cy = rect.y + rect.height / 2;
int fy = cy + fm.xHeight / 2;



@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
posted on 2013-08-03 18:27 逛奔的蜗牛 阅读(2297) 评论(0)  编辑 收藏 引用 所属分类: JavaC/C++QtCocoa

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理