--业余delphi,lazarus爱好者

BGRABitmap图像操作2:加载一幅图片


   下载一幅图片,image.png。用程序显示这幅图片。



unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
  BGRABitmap, BGRABitmapTypes;

type

  { TForm1 }

  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormPaint(Sender: TObject);
  private
    { private declarations }
    image: TBGRABitmap;

  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  image := TBGRABitmap.Create('image.png');

end;

procedure TForm1.FormPaint(Sender: TObject);
begin
  image.Draw(Canvas,0,0,True);

end;

end.



阅读更多
上一篇BGRABitmap图像操作1:最简单的例子,在窗体上画一个长方体
下一篇BGRABitmap图像操作3:用鼠标在窗体画断续的曲线
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭