I am writing a simple image editor for my project.
Here you can see the image in the editor:

Above TImage I put some TLabel.
In the preview, you can see the result of drawing TLabels in the image:

To draw TLabels, I wrote this code:
procedure TPrintForm.BuildPreview(aSsignTo: TImage); var Img: TBitmap; i: Integer; begin Img := TBitmap.Create; try Img.Assign(fSrcBitmap); for i := 0 to Count - 1 do begin Img.Canvas.Font := Items[i].Text.Font; Img.Canvas.TextOut(Items[i].Text.BoundsRect.TopLeft.X - Items[i].Text.Font.Size, Items[i].Text.BoundsRect.TopLeft.Y - Items[i].Text.Height - Items[i].Text.Font.Size, Items[i].Text.Caption); end; aSsignTo.Picture.Assign(Img); finally FreeAndNil(Img); end; end;
As a result, I have an image where the highlighted TLabel has a white background under the text. How to draw a TLabel without it?
source share