后端开发
delphi窗体FORM添加背景图片
发布时间:2024-04-01 22:57:30 浏览量:65
unit jmmh;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); //核心定义
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Bmp: TBitmap; //核心定义Bmp
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject); //以下是核心内容
begin
Bmp:= TBitmap.Create;
Bmp.LoadFromFile('D:delphiworksjiemianmeihuabxgh.bmp');
Brush.Bitmap := Bmp;
end;
procedure TForm1.FormDestroy(Sender: TObject); //以下是核心内容
begin
Bmp.Free;
end;
end.