¿Por que los 2 códigos del TTimmer trabajan de diferente forma?
Código Delphi
[-]
procedure TForm1.FormCreate(Sender: TObject);
begin
G:= TBitMap.Create;
G.LoadFromFile(getcurrentdir+'/molecule14.bmp');
G.TransparentColor:=G.Canvas.Pixels[1,1];
G.Transparent:= True;
G.TransparentMode:= tmFixed;
end;
Opción 1 :
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Canvas.Brush.Color := clBtnFace;
Canvas.FillRect(Rect(10+i-2, 10, 10+I, 10+G.Height)); Bitblt(Canvas.Handle, 10 + i, 10, G.Width, G.Height, G.Canvas.Handle, 0, 0, SRCCOPY);
i:=i+2;
end;
Opción 2 :
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Canvas.Brush.Color := clBtnFace;
Canvas.FillRect(Rect(10+i-2, 10, 10+I, 10+G.Height)); Canvas.Draw(10+i,10,G);
i:=i+2;
end;
En un principio cuando no había que transparentar el BitMap cualquier opción valía (BitBtl o Draw) pero cuando intenté transparentar en TForm1.FormCreate, BitBtl no hace nada, y Draw INTENTA transparentar, pero ocurre un efecto especial (adjunto el Archivo) al evento OnMouseMove: al principio transparenta su parte izquierda y luego se completa como era el BitMap originalmente (solo la izquierda) y la derecha está transparentado.
1.- ¿A que se debe todo este efecto con Draw?
2.- ¿Como hacer funcionar el transparente con BitBtl?