Closed carloBarazzetta closed 3 years ago
Hi Carlo. This can be fixed by adding a line to TColorRenderer.RenderProc in Img32.Draw as demonstrated below:
procedure TColorRenderer.RenderProc(x1, x2, y: integer; alpha: PByte);
var
i: integer;
dst: PColor32;
begin
dst := GetDstPixel(x1,y);
for i := x1 to x2 do
begin
//BlendToAlpha is marginally slower than BlendToOpaque but it's used
//here because it's universally applicable.
//Ord() is used here because very old compilers define PByte as a PChar
if Ord(alpha^) > 1 then // ADD THIS LINE
dst^ := BlendToAlpha(dst^, ((Ord(alpha^) * fAlpha) shr 8) shl 24 or fColor);
inc(dst); inc(alpha);
end;
end;
ps: the use of Ord() above may seem strange but it's necessary for Delphi 7 compatability.
Fixed in 3.1.1 version
I've found some problems on FMX drawing after update to Image32 3.4.1 A strange "white" surround of images and some icons with white background instead of transparency.