On Mon, 05 Feb 2007 11:36:13 +0100
Vincent Snijders <[EMAIL PROTECTED]> wrote:

> Павел Ишенин schreef:
> > Hello.
> > 
> > I found one incompability with TCanvas.TextOut method:
> > 1) In Delphi TCanvas.TextOut calls Windows.ExtTextOut wich fills 
> > bachground with brush
> > 2) In Lazarus TCanas.TextOut use fpc canvas class to draw text and
> > it works without filling text area with brush.
> 
> That is not what I found. It calls Windows.ExtTextOut too.
> 
> I found out that, changing line 138 of canvas.inc from
>    SetBkMode(FHandle, TRANSPARENT);
> to
>    SetBkMode(FHandle, OPAQUE);
> fixes this problem.

For Delphi compatibility I replaced it with:
  if Brush.Style=bsSolid then
    SetBkMode(FHandle, OPAQUE)
  else
    SetBkMode(FHandle, TRANSPARENT);

Does this fix the problem?


> > 
> > The problem is that I dont know what should be patched: lcl / fpc
> > (or all applications that use TextOut :) )
> 
> I also don't know what to fix:
> - TCanvas.CreateBrush
> or
> - TCanvas.TextOut to call SetBkMode if TextStyle.Opaque is true.
> or
> - TWin32WidgetSet.ExtTextOut to call SetBkMode, if Options is
> ETO_OPAQUE.


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to