Brush.Bitmap problems

Adam Starkey <[email protected]> Thu, 7 Nov 2002 13:20:08 -0600
Newsgroups gmane.comp.lang.delphi.kylix
Message-ID <[email protected]>
Hi,

does anyone know why:

PaintBox1.Canvas.Brush.Bitmap := nil;
PaintBox1.Canvas.Brush.Color := clRed;
PaintBox1.Canvas.Rectangle(Rect(0,0,200,200));

doesn't work as I would expect?

I'm assigning the brush.bitmap as nil[1] because I have no way of knowing what 
state it is in before this code runs, and I want to draw a simple filled 
rectangle.

Without the bitmap := nil assignment, the rectangle draws as a filled object 
correctly, but when I unassign the bitmap value, the rectangle draws, but 
without a fill value.  IE it behaves as if I had used Polygon instead of 
Rectangle... 

Why does the brush fail when assigning, even an already nil, bitmap the value 
of nil?

[1] in the production code I'm keeping a reference to the initial bitmap 
value, and reassigning it after at the end of the procedure. 

-- 
adam

-------------------------------------------------------
Forum / mailing list for Borland Kylix programmers
Our web page:  http://groups.yahoo.com/group/kylixgroup
To join the forum: [email protected]
To unsubscribe:  [email protected]
To post your messages:       [email protected]
To contact the moderator:  [email protected]
------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/