[Lazarus] Clear font backgrounds

Dave Coventry dgcoventry at gmail.com
Mon Apr 13 18:36:36 CEST 2009

2009/4/13 Martin Friebe <lazarus at mfriebe.de>:
> After "SetBKMode" try to output text as usual, eg with:
> "Image1.Canvas.TextOut()".  (or whatever it is, I don't recall exactly)
> This may already work, I haven't tried it....

No, it doesn't, I'm afraid.

> What I have used is:
>  dc := Canvas.Handle;
>  SetBkMode(dc,  TRANSPARENT);
>  LCLIntf.ExtUTF8Out(dc, X, Y, 0, @ARect, Text, Length, nil);
> ARect is a TRect thats specifies where the text goes. Unless you use
> clipping, only the top edge matters (since the background is transparent
> too)
> Example can be found in SynEdit:  components\synedit\syntextdrawer.pp
> line 1175 (the line refers to the SVN version; use search otherwise);
> the BKMode is set in synedits main unit.

I've found an easier way:

Set Image1.Canvas.Bruch.Style:=bsClear.

Works fine.

More information about the Lazarus mailing list