unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
BGRAVirtualScreen, BGRABitmap, BGRABitmapTypes;
type
{ TForm1 }
TForm1 = class(TForm)
BGRAVirtualScreen1: TBGRAVirtualScreen;
Timer1: TTimer;
procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
bm : TBGRABitmap;
alpha,z : integer;
// zoom
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
bm := TBGRABitmap.Create('girls2.png');
alpha := 255;
end;
procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
var
bw: TBGRABitmap;
bw2: TBGRABitmap;
bw3: TBGRABitmap;
begin
bw := bm.FilterGrayScale as TBGRABitmap;
bw2:= bm.FilterGrayScale as TBGRABitmap;
bw3:= bm.FilterGrayScale as TBGRABitmap;
bitmap.StretchPutImage(Rect(0-z,0-z,0+640+z,0+400+z),bm,dmSet,alpha);
// Trilinear zoom test ;
bitmap.StretchPutImage(Rect(0-z,0-z,0+640+z,0+400+z),bw2,dmFastBlend,-alpha);
if(alpha=1) then
begin
bitmap.StretchPutImage(Rect(2-z,2-z,2+640+z,2+400+z),bw,dmFastBlend, 150);
bitmap.StretchPutImage(Rect(4-z,4-z,4+640+z,4+400+z),bw3,dmFastBlend,100);
end
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
dec(alpha);
if(alpha <1) then
begin
alpha :=1;
inc (z,1);
if (z>655) then
begin
z := 0;
end;
end;
BGRAVirtualScreen1.RedrawBitmap;
end;
end.