在BCB中如何实现显示或打印字型的变化?

CCLIS 2001-11-30 11:21:56
在BCB的TFONT中,只有字体的Height或Size属性可以修改,显示的都是方块汉字,如果我想显示长形或扁形的汉字,应该如何编程?
...全文
43 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
AP 2001-12-01
  • 打赏
  • 举报
回复
//绘制自定文本
Procedure TNetMap.TextOutAngle(x,y,aAngle,aHeight:LongInt; FontName,txt:String);
Var NewFont,OldFont:LongInt;
DC:hDC;
Begin
If Length(txt)=0 Then Exit;

dc:=DrawCanvas.Handle;
NewFont:=CreateFont(aheight,0,aAngle*10,0,fw_normal,0,0,0,1,4,$10,DEFAULT_QUALITY,4,PChar(Fontname));
OldFont:=SelectObject(dc,NewFont);

TextOut(dc,x,y,PChar(txt),Length(txt));

SelectObject(dc,OldFont);
DeleteObject(NewFont);
End;

需要改变宽高比的话自己修改一下
耙子 2001-12-01
  • 打赏
  • 举报
回复
请你参考
CreateFont
The CreateFont function creates a logical font with the specified characteristics. The logical font can subsequently be selected as the font for any device.

HFONT CreateFont(
int nHeight, // height of font
int nWidth, // average character width
int nEscapement, // angle of escapement
int nOrientation, // base-line orientation angle
int fnWeight, // font weight
DWORD fdwItalic, // italic attribute option
DWORD fdwUnderline, // underline attribute option
DWORD fdwStrikeOut, // strikeout attribute option
DWORD fdwCharSet, // character set identifier
DWORD fdwOutputPrecision, // output precision
DWORD fdwClipPrecision, // clipping precision
DWORD fdwQuality, // output quality
DWORD fdwPitchAndFamily, // pitch and family
LPCTSTR lpszFace // typeface name
);
他就是你要找的东西。别告诉我看不懂,否则你的……
CCLIS 2001-12-01
  • 打赏
  • 举报
回复
哦,都要调用WINDOWS 的API 函数,我想用BCB里面的TFONT来更改,怎么没想到API,呵呵,笨蛋一个。

13,825

社区成员

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

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