Board index » delphi » refreshing visible part of a canvas.

refreshing visible part of a canvas.

Hello,

I have a big paintbox inside a scrollbox.
I don't want to redraw on all the paintbox canvas for speed reason, I would
like to draw only on the visible part.
how can I get the rectangle coordinates of the visible part?

thanks

Armindo

 

Re:refreshing visible part of a canvas.


Quote
ADS wrote:
> I have a big paintbox inside a scrollbox.
> I don't want to redraw on all the paintbox canvas for speed reason, I
> would like to draw only on the visible part.
> how can I get the rectangle coordinates of the visible part?

Left = ScrollBox.HorzScrollBar.Position
Top = ScrollBox.VertScrollBar.Position
Right = Left + ScrollBar.ClientWidth
Bottom = Top + ScrollBar.ClientHeight

I am guessing you want to redraw only a part of bigger image on the
paintbox according to scroll bars.

--
Liran
www.com-n-sense.com

Re:refreshing visible part of a canvas.


Quote
> I am guessing you want to redraw only a part of bigger image on the
> paintbox according to scroll bars.

yes, thanks

Armindo

Re:refreshing visible part of a canvas.


With the VCL, use PaintBox.Canvas.ClipRect. With CLX, it don't give you
the right area. Does anybody know why?

--
Eric SIBERT

http://www.ericsibert.com

Other Threads