How to draw text on TCanvas without white background under painted text?
delphi, delphi-xe4
Solution
Thanks to all for answers. I found solution here:
SetBkMode(Img.Picture.Bitmap.Canvas.Handle,TRANSPARENT);
Problem resolved.
Problem
I am writing simple image editor for my project. There you can see the image in editor: Above TImage, I placed the few TLabel. In preview you can see result of drawing TLabels on image: For drawing 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 result I have the image, where drawed TLabel have white background under text. How to draw TLabel without it?