//uses wincrt, intfgraphics, windows, SysUtils, FileUtil,
// EpikTimer, Forms, Controls, Graphics, LResources, Process, ExtCtrls,
// Dialogs, StdCtrls, LCLProc, ActnList, LCLIntf, LCLType, Interfaces,
// Buttons, ExtDlgs, Menus, ComCtrls, strutils, Classes,
// GraphType, LazLogger;
procedure TForm1.Button1Click(Sender: TObject);
var timeperiod,extvar1:extended;
i:integer;
picture:TPicture;
mypng:TPortableNetworkGraphic;
tempstr1,filenum:string;
elapsedtime:string;
newimage: TLazIntfImage;
lRawImage: TRawImage;
tempvar1:integer;
begin
epiktimer1.clear;
epiktimer1.start;
lRawImage.Init;
lRawImage.Description.Init_BPP32_A8R8G8B8_BIO_TTB(0,0);
lRawImage.CreateData(false);
newimage := TLazIntfImage.Create(0,0);
newimage.SetRawImage(lRawImage);
newimage.DataDescription:=GetDescriptionFromDevice(0);
mypng := TPortableNetworkGraphic.create;
picture := TPicture.create;
i := 0;
go := true;
edit1.text := '';
tempvar1 := 361;
application.processmessages;
while (i < tempvar1) and (go) do
begin
application.processmessages;
i := i + 1;
str(i,filenum);
// #1 4.1 sec. (.exe) Transparent no
//newimage.LoadFromFile('c:\temp15\bin4\image'+filenum+'.png');
//Image1.picture.Bitmap.LoadFromIntfImage(newimage);
// #2 4.9 sec. (.exe) Transparent yes
//picture.loadfromfile('c:\temp47\image'+filenum+'.png');
//image1.picture := picture;
// #3 5.6 sec. (.exe)
//picture.loadfromfile('c:\temp47\image'+filenum+'.png');
//image1.canvas.draw(0,0,picture.Graphic);
// #4 5.2 sec. (.exe) Transparent: yes
//image1.picture.loadfromfile('c:\temp47\image'+filenum+'.png');
// #5 4.1 sec. (.exe) Transparent no
newimage.LoadFromFile('c:\temp47\image'+filenum+'.png');
mypng.LoadFromIntfImage(newimage);
image1.canvas.draw(0,0,mypng);
end;
newimage.free;
sound(350);
timeperiod := epiktimer1.elapsed;
elapsedtime := FloatToStr(timeperiod);
edit1.text := 'Time:> '+elapsedtime;
picture.free;
mypng.free;
end;