[Lazarus] [?? Probable Spam] Re: Paintbox complete redraw
Bogusław Brandys
brandys at o2.pl
Wed Sep 24 08:09:14 CEST 2008
Howard Page-Clark pisze:
> Benito van der Zander wrote:
>
>
>> is there a way to change the whole paintbox in the OnPaint event?
>> For example, if I draw this in Onpaint:
>> PaintBox1.Canvas.brush.Color:=rgb(random(255),random(255),random(255));
>> PaintBox1.Canvas.Rectangle(0,0,100,100);
>> and move another window in XP over the paintbox it is striped instead of
>> being filled with a single color.
>
> When the window covering PaintBox1 is removed, the operating system repaints only the newly exposed region, which your code fills
> with a (new) randomly generated colour. Unless by chance that new colour happens to coincide with the previous Paintbox colour it
> will look like exactly what you have coded for: a randomly coloured stripe.
> If you replace
> rgb(random(255),random(255),random(255))
> with
> rgb(100, 100, 100)
> you'll not notice the repainting because it will be painted in the same indistinguishable colour as before (well, there might be
> some flicker).
>
> Howard
>
> ____________
What is the cause of flicker ? I see it is common problem in Lazarus for
all controls under Windows ?
did you found the reason ?
Boguslaw
More information about the Lazarus
mailing list