Board index » delphi » Help: Problem with FillRect for Tcanvas.Brush.Style

Help: Problem with FillRect for Tcanvas.Brush.Style

When using the FillRect method of a TCanvas object, a rectangle is
drawn, filled in with the Canvas'es TBrush object's style, color etc.
Setting the Tcanvas.Brush.Style other than bsSolid (bsDiagCross fior
example) is supposed to cause the brush to paint its Color onto the
rectangle in the specified color, according to the pattern specified
What happens to the pixels in between the pattern though is not
clearly defined. In my experience, these pixels have not been affected
(ie in between a DiagCross pattern, the previous color was left
undisturbed ) Suddenly now in my app, the in-between pixels are
painted black (ie the DiagCross pattern appears fine, but the
background color is not as I left it, but black). How is this
background color specified? I can't find a property anywhere that
specifies this. (I have set the Tcanvas.CopyMode to cmSrcCopy) (When
Brush.Style is set to bsClear the original color IS left undisturbed)

Any help?
Thanks in advance.
Dave
i...@global.co.za

 

Re:Help: Problem with FillRect for Tcanvas.Brush.Style


I've had this problem when using a "Delphi color" such as clWindow, clBlue
etc.  Converting the color to a windows RGB color using the ColorToRGB
function has gotten rid of the black background for me in these cases.

Regards Jeff.

Quote
Dave Boltman wrote:
> When using the FillRect method of a TCanvas object, a rectangle is
> drawn, filled in with the Canvas'es TBrush object's style, color etc.
> Setting the Tcanvas.Brush.Style other than bsSolid (bsDiagCross fior
> example) is supposed to cause the brush to paint its Color onto the
> rectangle in the specified color, according to the pattern specified
> What happens to the pixels in between the pattern though is not
> clearly defined. In my experience, these pixels have not been affected
> (ie in between a DiagCross pattern, the previous color was left
> undisturbed ) Suddenly now in my app, the in-between pixels are
> painted black (ie the DiagCross pattern appears fine, but the
> background color is not as I left it, but black). How is this
> background color specified? I can't find a property anywhere that
> specifies this. (I have set the Tcanvas.CopyMode to cmSrcCopy) (When
> Brush.Style is set to bsClear the original color IS left undisturbed)

> Any help?
> Thanks in advance.
> Dave
> i...@global.co.za

Other Threads