@Paul

Recently, landed in svn an implementation of CreatePatternBrush for gtk.
I'd like to point that for some time a patch fixing the creation of pattern brushes through CreateBrushIndirect is available in mantis (see: http://www.freepascal.org/mantis/view.php?id=8814)

It has some advantages over the recent addition:

1) Fix the more generic function (CreateBrushIndirect), so if the user try to create a bitmap pattern using a TBrushLog will not get an error. In fact, based in my tests, it seems that win32.CreatePatternBrush is just a wrapper around CreateBrushIndirect

2) Works both for monochrome as well to color bitmaps/pixmaps. In the svn will work only for monochrome

3) Implementing CreatePatternBrush is as simple as:

function CreatePatternBrush(hbmp:HBITMAP):HBRUSH;
var
 Log: TLogBrush;
begin
 with Log do
 begin
   lbColor := 0;
   lbHatch := hbmp;
   lbStyle := BS_PATTERN;
   Result := CreateBrushIndirect(Log);
 end;
end;

Obs: recently gtkobject.inc file got renamed, so the patch will not apply without manual edit. I will update it as soon as possible

Luiz

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

Reply via email to