Quote
support alpha blending
Quote
streaming jpg2000
Quote from: jdarling on 5 October 2007, 22:27:31
My other request would be getting transparency working when blitting :(.
Quote from: sofakng on 27 November 2007, 16:20:58
I'd really like it to support alpha blending...
procedure BlendImageTo(WhatCanvas: TCanvas; ImageData : TImageData; SourceRect : classes.TRect; DestX, DestY : Integer; AlphaThreshold : Byte = 255);
var
ax, ay,
ix, iy : integer;
c32 : TColor32Rec;
begin
iy := DestY;
for ay := SourceRect.Top to SourceRect.Bottom do
begin
ix := DestX;
for ax := SourceRect.Left to SourceRect.Right do
begin
c32:= GetPixel32(ImageData, ax, ay);
if c32.A >= AlphaThreshold then
WhatCanvas.Pixels[ix, iy] := RGBToColor(c32.R, c32.G, c32.B);
inc(ix);
end;
inc(iy);
end;
end;
Of course thats extremely slow and not really a good way to perform the blit :(. It also doesn't handle the alpha blending, but hey it works :).Page created in 0.035 seconds with 19 queries.