gettingstarted
[Top] [All Lists]

Re: Scrolling graphs

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Scrolling graphs
From: Barrie Jones <barrie at spamcop dot net>
Date: Mon, 25 Oct 2004 14:05:39 -0400
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <F72BBDEF-262A-11D9-9A86-000D93C6DE52 at spamcop dot net> <a05300b1dbda21f02e259 at [10 dot 10 dot 13 dot 6]> <B1C09B92-269D-11D9-9A86-000D93C6DE52 at spamcop dot net> <a05300b10bda2d6745bb1 at [10 dot 10 dot 13 dot 6]>
You really don't need a picture for this. Here's a quick example of a scrolling canvas:

1. Throw a canvas on the window, with scrollbars next to it, called HScroller (for horizontal) and VScroller (for vertical).

2. Make a method like this:

Sub DrawContent( g as Graphics )
  g.ClearRect 0, 0, g.width, g.height
  g.textSize = 128
  g.DrawString "This is a test, just a test.  See how it scrolls?", _
     200 - HScroller.Value, 400 - VScroller.Value
End Sub

3. In the ValueChanged event of each scrollbar, put:

  DrawContent Canvas1.graphics

4. In the Canvas1.Paint event, put:

  DrawContent g

5. Run the app.

That should do it. It's off the top of my head though, so it may contain some errors, but I hope it gets you started. Replace the guts of DrawContent with your own drawing code, and you should be all set.

Many thanks. It worked fine and it is all I needed to get started.

Barrie

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>