1,183
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var
n: integer;
int1, int2: integer;
OldFont, NewFont: HFONT;
LogRec: TLOGFONT;
begin
GetObject(Canvas.Font.Handle, SizeOf(LogRec), @LogRec); // Get the current LogicFont setting
with LogRec do
begin
lfheight := 70;
lfwidth := 50;
lfFaceName := '宋体';
lfCharset := GB2312_CHARSET;
lfEscapement := 0;
lfUnderLine := 0;
lfItalic := 0;
lfStrikeOut := 0;
end;
NewFont := CreateFontIndirect(LogRec);
OldFont := SelectObject(Canvas.Handle, NewFont);
Canvas.textout(1, 1, '10');
LogRec.lfwidth := 100;
NewFont := CreateFontIndirect(LogRec);
OldFont := SelectObject(Canvas.Handle, NewFont);
Canvas.textout(1, 100, '9');
end;