Eyes的代码应该与下面的代码功能差不多:
b:=tbitmap.Create;
b.LoadFromFile('h.bmp');
b.Transparent:=true;
b.TransparentMode:=tmauto;//tmfixed;
for i:=0 to 200 do
begin
Canvas.Draw(i, i, b);
sleep(20);
end;
b.free;
这样的缺点就是b会自动用b的左上角的颜色作为透明色,
这样就会留尾巴,
于是我就改了改,
试试这样:
var
b,c,d:tbitmap;
i,j:integer;
PaintDC: HDC;
MaskRect: TRect;
SavedRgn: HRgn;
SavedBox: TRect;
begin
b:=tbitmap.Create;
b.LoadFromFile('h.bmp');
c:=tbitmap.Create;
c.Width:=2;
c.Height:=b.Height;
d:=tbitmap.create;
d.width:=b.width;
d.height:=2;
b.Transparent:=true;
b.TransparentMode:=tmauto;//tmfixed;
for i:=0 to 200 do
begin
c.Canvas.CopyRect(rect(i,i,2,b.height),form1.canvas,rect(i,i,i+2,i+b.height));
d.Canvas.copyrect(rect(i,i,b.width,1),form1.canvas,rect(i,i,i+b.width,i+2));
Canvas.Draw(i, i, b);
sleep(20);
form1.Canvas.CopyRect(rect(i,i,i+c.width,i+c.height),c.canvas,rect(0,0,c.width,c.height));
form1.Canvas.CopyRect(rect(i,i,i+d.width,i+d.height),d.canvas,rect(0,0,d.width,d.height));
end;
b.free;
c.free;
d.free;
end;
不知Eyes还有什么好办法。