No wiec mam taki pomysl:
na Form1 jest Image1 (TImage) oraz Timer1 (TTimer)
Timer jest Enabled False, Interval 250
Kod wyglada nastepujaco (tworzy bitmapy, ty powinienes zaladowac z pliku).
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
Bitmapy :array [0..1] of TBitmap;
Counter : Integer;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Image1.Picture.Assign(Bitmapy[Counter]);
Counter:=1-Counter;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Timer1.Enabled:=False;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
Timer1.Enabled:=True;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i:integer;
begin
for i:=0 to 1 do
begin
Bitmapy[i]:=TBitmap.Create;
Bitmapy[i].Height:=Image1.Height;
Bitmapy[i].Width:=Image1.Width;
end;
Bitmapy[0].Canvas.Brush.Color:=clGreen;
Bitmapy[0].Canvas.FloodFill(0,0,clWhite,fsSurface);
Bitmapy[1].Canvas.Brush.Color:=clRed;
Bitmapy[1].Canvas.FloodFill(0,0,clWhite,fsSurface);
Counter:=0;
Image1.Picture.Assign(Bitmapy[0]);
Form1.DoubleBuffered:=True;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Bitmapy[0].Destroy;
Bitmapy[1].Destroy;
end;
end.
Nie wiem, czy jest sensowny, ale tyle wymyslilem... Przynajmniej dziala {hello}
--Pawel
Delphi6