以下是我编的程序,你可以暂时参考:
(我用label1和label2代替你的图片,image2的transparent属性为true)
... ~~~~~~ ~~~~~~~~~~~ ~~~~~
private
aa01x,aa01y:integer;
aa02x,aa02y:integer;
...
procedure TForm1.FormCreate(Sender: TObject);
var
xx,yy:integer;
begin
image2.Visible := false;
//
xx := image2.width-1;
yy := image2.height-1;
//
while not(xx<0) do
begin
while not(yy<0) do
begin
<font color=green>image2.Canvas.Pixels[xx,yy] := clBlue;</font>
<font color=green>yy := yy-<b>3</b>;</font>
end;
<font color=green>xx := xx-<b>3</b>;</font>
yy := image2.height-1;
end;
image2.Visible := true;
end;
procedure TForm1.Label1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
aa01x := x;
aa01y := y;
end;
procedure TForm1.Label2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
aa02x := x;
aa02y := y;
end;
procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image2.Left := aa01x+label1.left;
image2.Top := aa01y+label1.top;
image2.Visible := true;
end;
procedure TForm1.Label2MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
image2.Left := aa02x+label2.left;
image2.Top := aa02y+label2.top;
image2.Visible := true;
end;
-----------------------------------------------------------------------
不过,这不是一个好方法
我想你是否可以改变 要变色图的色度(可能要扫描所有的象素点)
另,我再调试程序时发现,要是把上面绿字的“3”改成“2”,
delphi画的都是“白点”??
谁有好方法也请告诉我,谢!