DELPHI XE 10.2.1 FMX平台 在图片上写字方法


本文整理自网络,侵删。

 
unit Unit1;
 
interface
 
uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects,
  FMX.Controls.Presentation, FMX.StdCtrls;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    Image1: TImage;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
 
implementation
 
{$R *.fmx}
 
procedure TForm1.Button1Click(Sender: TObject);
var
   Rect: TRectF;
begin
   Rect.Create(0, 0, 500, 300);
   Image1.Bitmap.Canvas.BeginScene;
   Image1.Bitmap.Canvas.Font.Family:='宋体';
   Image1.Bitmap.Canvas.Font.Size:=80;
   Image1.Bitmap.Canvas.Fill.Color:=TAlphaColors.Red;
   Image1.Bitmap.Canvas.FillText(Rect, '我是LQEN', False, 1, [], TTextAlign.Center, TTextAlign.Center );
   Image1.Bitmap.Canvas.EndScene;
end;
 
 
end.

――――――――――――――――

原文链接:https://blog.csdn.net/lqena/article/details/78732313

相关阅读 >>

Delphi 读写文本文件

Delphi 关于 array of const

Delphi 坐标截图如何实现

Delphi unicode转换ansi

Delphi创建密钥文件

Delphi thttpclient 时获取跳转后的 url

Delphi 在目录后面加上一个 "\"

Delphi image1 图像旋转90

Delphi 字符串操作之格式化

Delphi 屏幕渐变效果的源代码

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



打赏

取消

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

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

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

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

评论

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