Re:problem with Brush & FillRect
I found an error in my code that cause OutOfRessources. Since it was resolved, I didn't have the background problem anymore. So, I conclude that the background problem was the result of that.
Thanks to you all for your help!!
Melanie
"hooger" <mberge...@NOSPAM.eduglobe.ca> wrote in message news:HmMC9.3336$Zp1.110190@charlie.risq.qc.ca...
Here's some details :
At first, I write into a TBitmap and after, I update it to the TPaintBox. I don't use TImage because, as you said Jeremy, it makes flickering lines on image and with a TPaintBox I don't have this problem. Too, I noticed that the problem is not only at the level of the TPaintBox, it's the Bitmap that is not ok and I draw the bitmap on the TPaintBox, so I see that the problem comes from the bitmap. I don't notice any pattern to the times that the background is not blanked, but once it occur, I can't draw any background without restarting the program. It's like if a TBrush or anything were not available anymore. Is it possible??
Thanks!!!
Melanie
"hooger" <mberge...@NOSPAM.eduglobe.ca> wrote in message news:UwyC9.852$Zp1.78531@charlie.risq.qc.ca...
> Hi all!
>
> In my program I do many changes in a TBitmap and display it in a TPaintBox.
>
> Many times in the program I call DecodeRect which does that:
>
> DecodeRect(BGColor: TRGBTriple, Rect: TRect, ImgDest: TBitmap, ...)
> begin
> ImgDest.PixelFormat := pf24bit;
> //DRAW THE BG FOR THE RECT
> ImgDest.Canvas.Brush.Color := RGB(BGColor.rgbtRed, BGColor.rgbtGreen,
> BGColor.rgbtBlue);
> ImgDest.Canvas.Brush.Style := bsSolid;
> ImgDest.Canvas.FillRect(Rect);
> //DRAW LINES
> //Here, I have a buffer with lines to draw. I draw these lines with
> access by Scanline
> ...
>
> Generally, it works perfectly. But at a random moment, the background is
> not drawn but lines are. So the lines are just drawn the ones over the
> others and it's a real scribble!!! But no error was raised and if I put a
> breakpoint, I can see that BGColor and Rect are ok.
>
> I wonder if the problem is FillRect or the brush?? Did I do the right thing
> with Brush and FillRect? Otherwise, do you have any alternative to suggest
> me?
>
> Thanks!!!
>
>
> Melanie
>
>