How to scroll large drawings/large docs?

  • Thread starter Thread starter Frankie D.
  • Start date Start date
F

Frankie D.

Hi,

I have a "document". My doc can be divided to thousends of lines. Every line
can be displayed as a drawing, every line has an OnPaint method. How can be
displayed this document??? The height of every line is 75.

If each line is reperesented by separate controls the program will be very
slow, because thousands of controls must be checked every time wether they
are on the screen or not (?).

If the whole document is reperesented by one control size limitation seems
to be exceeded: the height of my "one and only" control should be more than
75000. System.Windows.Forms can not be resized (or not always can be resized)
to this height. The limit is 32767. ( My very large control is on a Panel in
this case.

I don't know the general way to handle large docs. Please help!!!

Frankie
 
The basic answer is 1) that's a bad design of the UI and 2) since you have a
large amount of data, you're not going to be able to have a single panel or
something that will actually contain everything. You'll have to build what
I might call a virtual panel, attach a scroll bar and, based on the scroll
bar position you, yourself, will have to decide what pieces your control
"contains" (not really, but virtually), to draw, calling then appropriately.
That is, *you* take over from the window manager to figure out what's
visible and to call those items and tell them where in the unscrolled area
of your virtual panel to draw (nothing is ever scrolled; the scroll bar just
tells you where you should look for the items to be drawn).

Don't underestimate the advantages of actually rethinking your design, but
it is certainly possible to do 2.

Paul T.
 
Thank you for your answer.

Paul G. Tobey said:
The basic answer is 1) that's a bad design of the UI and 2) since you have a
large amount of data, you're not going to be able to have a single panel or
something that will actually contain everything. You'll have to build what
I might call a virtual panel, attach a scroll bar and, based on the scroll
bar position you, yourself, will have to decide what pieces your control
"contains" (not really, but virtually), to draw, calling then appropriately.
That is, *you* take over from the window manager to figure out what's
visible and to call those items and tell them where in the unscrolled area
of your virtual panel to draw (nothing is ever scrolled; the scroll bar just
tells you where you should look for the items to be drawn).

Don't underestimate the advantages of actually rethinking your design, but
it is certainly possible to do 2.

Paul T.
 
Back
Top