unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
BGRAVirtualScreen, BGRABitmap, BCTypes, BGRABITMAPTYPES;
type
{ TForm1 }
TForm1 = class(TForm)
BGRAVirtualScreen1: TBGRAVirtualScreen;
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
procedure BGRAVirtualScreen1Exit(Sender: TObject);
procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
public
BMP1 : TBGRABITMAP ;
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
if FileExists('sample.png') then begin
BMP1 := TBGRABITMAP.CREATE('sample.png');
MEMO1.CLEAR;
MEMO1.Lines.Add('sample.png loaded');
end else begin
showmessage('sample.png not in path');
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
BGRAVirtualScreen1.RedrawBitmap;
end;
procedure TForm1.BGRAVirtualScreen1Exit(Sender: TObject);
begin
BMP1.FREE;
end;
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
BITMAP.PUTIMAGE(0,0,BMP1,dmset,255);
end;
end.