thanks for your help but there are some "dark points"
1 - if i use FPictureON.Bitmap.Canvas.Colors[px,py] the alpha channel doesn't work ( read or write). For this i use always in my code the temporary TLazIntfImage.
2 - the members of the TFPColor are word not byte and if i affect for example the red member to a byte value r, this doesn't work . I must use TColorToFPColor to have the good values in the TFPColor
finally here is my code :
SetHue( hue : byte);
t: TLazIntfImage;
px,py : integer;
CurColor: TColor;
CurFPColor: TFPColor;
r,g,b,h,l,s : byte;
alpha : word;
begin
try
t := FpictureON.Bitmap.CreateIntfImage;
for py:=0 to FPictureON.Bitmap.Height-1 do begin
for px:=0 to FPictureON.Bitmap.Width-1 do begin
curFPColor := t.Colors[px,py];
RedGreenBlue(CurColor,r,g,b);
alpha := curFPColor.alpha;
RGBtoHLS(lo(curFPColor.red),lo(curFPColor.green),lo(curFPColor.blue),h,l,s);
HLStoRGB(hue,l,s,r,g,b);
// curFPColor.red := r; // doesn't work
curFPColor := TColorToFPColor(RGBToColor(r,g,b));
curFPColor.alpha := alpha;
t.Colors[px,py] := curFPColor;
end;
end;
FpictureON.Bitmap.LoadFromIntfImage(t);
finally
t.free;
end;
Friendly, J.P