2
I’m using this code in Azarus but at the time of saving it shows a black part like the image, I wanted it to be white/transparent. I tried some manners and it didn’t work.
procedure TformMain.btSalvarImagemClick(Sender: TObject);
var
bmp: TBitmap;
R: TRect;
png : TPortableNetworkGraphic;
begin
// bmp, png
bmp := TBitmap.Create;
png := TPortableNetworkGraphic.Create;
try
// bmp
if SavePictureDialog1.Execute then
begin
R := Rect(500, 500, BarcodeQR1.Width, BarcodeQR1.Height);
bmp.SetSize(600, 600);
bmp.Canvas.Brush.Color := clWhite;
bmp.Canvas.FillRect®;
BarcodeQR1.PaintOnCanvas(bmp.Canvas, R);
png.Assign(bmp);
png.SaveToFile(SavepictureDialog1.Filename);
end;
finally
bmp.Free;
png.Free;
end;
end;`
It hasn’t worked out yet
– Jackson Felipe Magnabosco