I just want change the color.
var
I, J: integer;
C: TColor;
R, G, B: byte;
Bitmap: TBitmap;
begin
......
with Bitmap do begin
for J := 0 to Height - 1 do begin
for I := 0 to Width - 1 do begin
C := Canvas.Pixels[I, J];
R := integer(GetRValue(C)) div 1;
G := integer(GetGValue(C)) div 30;
B := integer(GetBValue(C)) div 30;
Canvas.Pixels[I, J] := TColor(RGB(R, G, B));
end;
end;
end;
end;
The color is changed, but also lost transparence.
And with this :
var
I, J: integer;
C: TColor;
R, G, B: byte;
Bitmap: TBitmap;
begin
......
with Bitmap do begin
for J := 0 to Height - 10 do begin
for I := 0 to Width - 10 do begin
C := Canvas.Pixels[I, J];
R := integer(GetRValue(C)) div 1;
G := integer(GetGValue(C)) div 30;
B := integer(GetBValue(C)) div 30;
Canvas.Pixels[I, J] := TColor(RGB(R, G, B));
end;
end;
end;
end;
The picture just lost the part I changed ( J := 0 to Height - 10 and I := 0 to Width - 10)
It's inconceivability.
Anyone can tell me why?
And also many function will destroy transparence like:
Bitmap.Width = xxx;
Bitmap.Canvas.CopyRect(xxx);
How can I keep the transparence?
Thank you.