4 years later, found 3 typos in ResizeMap !
procedure TForm1.ResizeMap;
var BRGAbitmap: TBGRABitmap;
var aBitmap : Tbitmap;
begin
aBitmap:=Tbitmap.Create;
aBitmap.SetSize(100, 100);
BRGABitmap := TBGRABitmap.Create(aBitmap);
BGRABitmap.DrawLineAntialias(0,0,100,100,clRed,5);
BRGABitmap.ResampleFilter:=rfBestQuality;
BGRAReplace (BGRAbitmap, BRGABitmap.Resample(90, 90, rmFineResample) );
BGRAbitmap.draw(Canvas, 0,0);
BRGABitmap.Free;
ABitmap.Free;
End;
procedure TForm1.ResizeMap;
var BRGAbitmap: TBGRABitmap;
aBitmap : Tbitmap;
begin
aBitmap := Tbitmap.Create;
aBitmap.SetSize(100, 100);
BRGABitmap := TBGRABitmap.Create(aBitmap);
//BGRABitmap.DrawLineAntialias(0,0,100,100,clRed,5); typo
BRGABitmap.DrawLineAntialias(0,0,100,100,clRed,5);
BRGABitmap.ResampleFilter:=rfBestQuality;
//BGRAReplace(BGRAbitmap, BRGABitmap.Resample(90, 90, rmFineResample) ); typo
BGRAReplace(BRGAbitmap, BRGABitmap.Resample(90,90,rmFineResample));
//BGRAbitmap.draw(Canvas, 0,0); typo
BRGAbitmap.draw(Canvas, 0,0);
BRGABitmap.Free;
ABitmap.Free;
End;
The lesson is : caution with BGRA <> BRGA !