PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework How to scroll large drawings/large docs?

Reply

How to scroll large drawings/large docs?

 
Thread Tools Rate Thread
Old 22-04-2008, 10:25 AM   #1
Frankie D.
Guest
 
Posts: n/a
Default How to scroll large drawings/large docs?


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


  Reply With Quote
Old 22-04-2008, 04:14 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: How to scroll large drawings/large docs?

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.

"Frankie D." <FrankieD@discussions.microsoft.com> wrote in message
news:82010327-0434-4CCA-93B7-6CA020D878E4@microsoft.com...
> 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
>
>



  Reply With Quote
Old 22-04-2008, 04:50 PM   #3
Frankie D.
Guest
 
Posts: n/a
Default Re: How to scroll large drawings/large docs?

Thank you for your answer.

"Paul G. Tobey [eMVP]" wrote:

> 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.
>
> "Frankie D." <FrankieD@discussions.microsoft.com> wrote in message
> news:82010327-0434-4CCA-93B7-6CA020D878E4@microsoft.com...
> > 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
> >
> >

>
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off