如何设置TMetafileCanvas的width,height?

lonelyegg 2003-04-29 03:26:28
我用TMetafileCanvas来实现在TMetafile上面作图。可是好像设置了WMF文件的width和height属性对生成的wmf文件不起作用。

TMetafileCanvas帮助中说:

TMetafileCanvas sets the size of the TMetafile object from the HDC passed as ReferenceDevice if it does not already have the MMHeight and MMWidth properties set.
TMetafileCanvas then creates a metafile device context, and sets the Handle property to its handle. All subsequent drawing methods will draw to the metafile device context.

不是很明白什么意思,那个HDC怎么用?

...全文
60 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yingyys 2003-04-30
  • 打赏
  • 举报
回复
TMetafile* pMetafile = new TMetafile;
pMetafile->Width = width;
pMetafile->Height = height;

TMetafileCanvas *pCanvas = new TMetafileCanvas(pMetafile, 0);

只要设置TMetafile 的高与宽就好
lonelyegg 2003-04-30
  • 打赏
  • 举报
回复
yingyys(鹰) :

我也这么做过,可是好像没有用啊。
我把这个wmf文件保存成文件,用acdsee打开发现大小根本不是我设置的大小。
lonelyegg 2003-04-29
  • 打赏
  • 举报
回复

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧