delphi 如何产生输出一个变形的图形及文字


本文整理自网络,侵删。

 procedure TForm1.SpeedButton1Click(Sender: TObject);
var
Bmp:Tbitmap;
Rect:Trect;
begin
Bmp:=Tbitmap.Create;
bmp.LoadFromFile('c:\1.bmp');
SetRect(Rect,0,0,self.Image1.Width,self.Image1.Height);
self.Image1.Canvas.StretchDraw(Rect,bmp);
self.Image1.Canvas.Font.Size:=80;
self.Image1.Canvas.Font.Name:='宋体';
SetRect(Rect,0,0,self.Image1.Width,self.Image1.Height);
self.Image1.Canvas.Brush.Style:=bsclear; //使输出的文字没有背景影响
self.Image1.Canvas.TextRect(Rect,0,0,'思');
self.Image1.AutoSize:=false;
self.Image1.Stretch:=true;
self.Image1.Width:=550; //这里可以任意修改图片的大小,可以起到变形的作用。
self.Image1.Height:=550;

self.Label1.Caption:=inttostr(self.Image1.Width);
self.Label2.Caption:=inttostr(self.Image1.Height);

end;

相关阅读 >>

Delphi fdquery遍历输出 json

Delphi 串口 字符串转换ascii

Delphi 10.2 新特性之―tfdbatchmovejsonwriter

Delphi memo1双击选中的文字内容

Delphi xe [dcc32 fatal error] f2039 could not create output file 问题的解决

Delphi的combobox不能输入只能选择

Delphi 复制动态数组

Delphi 编写系统服务

Delphi closefile 关闭文件

Delphi 快捷键

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...