One more "Giant Canvas" question
Author Message
One more "Giant Canvas" question

Okay,

I am re tooling the graphics display of my audio track sheet program but one
thing still baffles me.  Joe S. wrote the following.

Quote:
>Yes, the full drawing is 108000 pixels wide, but you're only drawing a
>small subset of this at any point in time, right?  Maybe the scroll
>position is 82050, and your canvas is 1000 pixels wide, so you're only
>drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
>of your coordinates before drawing, so the range of arguments to your
>drawing commands is 0-1000.

but how do you get to 82050 (for example) if your scroll bar only goes to
32,797.  Everything else I think I understand and I am simplifying my code.
Thanks for all your help.

Joel

Sun, 09 Oct 2005 03:24:51 GMT
One more "Giant Canvas" question

Quote:

> I am re tooling the graphics display of my audio track sheet program but one
> thing still baffles me.  Joe S. wrote the following.

> >Yes, the full drawing is 108000 pixels wide, but you're only drawing a
> >small subset of this at any point in time, right?  Maybe the scroll
> >position is 82050, and your canvas is 1000 pixels wide, so you're only
> >drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
> >of your coordinates before drawing, so the range of arguments to your
> >drawing commands is 0-1000.

> but how do you get to 82050 (for example) if your scroll bar only goes to
> 32,797.

Ah.  You define each increment of your scroll bar to be more than one
pixel.  Do people really *need* to be able to scroll by a single pixel
anyway?  Perhaps each scrollbar increment should 5 pixels, or 10.  Pick
an appropriate scroll scale, and just multiply the scrollbar value by
that to find the scroll position.

Cheers,
- Joe

,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'

Sun, 09 Oct 2005 04:24:24 GMT
One more "Giant Canvas" question

Quote:

>> I am re tooling the graphics display of my audio track sheet program but one
>> thing still baffles me.  Joe S. wrote the following.

>>> Yes, the full drawing is 108000 pixels wide, but you're only drawing a
>>> small subset of this at any point in time, right?  Maybe the scroll
>>> position is 82050, and your canvas is 1000 pixels wide, so you're only
>>> drawing frames 82050 - 83050.  The key is, you subtract 82050 from all
>>> of your coordinates before drawing, so the range of arguments to your
>>> drawing commands is 0-1000.

>> but how do you get to 82050 (for example) if your scroll bar only goes to
>> 32,797.

> Ah.  You define each increment of your scroll bar to be more than one
> pixel.  Do people really *need* to be able to scroll by a single pixel
> anyway?  Perhaps each scrollbar increment should 5 pixels, or 10.  Pick
> an appropriate scroll scale, and just multiply the scrollbar value by
> that to find the scroll position.

> Cheers,
> - Joe

> ,------------------------------------------------------------------.
> |    Joseph J. Strout         Check out the Mac Web Directory:     |

> `------------------------------------------------------------------'

Cool.  That is actually what I did but I wasn't sure if that was the
"correct" way.  I have run across a strange phenom.  I haven't "limited" the
size of my scroll yet so it is always at maximum.  If I use my zoom at all,
The graphics will actually redraw again further down the canvas!  I really
don't see how that is possible as the math would put the sound file
representation way out of bounds.

Strange...

Joel

Sun, 09 Oct 2005 04:43:20 GMT
One more "Giant Canvas" question

Quote:

> If I use my zoom at all,
> The graphics will actually redraw again further down the canvas!  I really
> don't see how that is possible as the math would put the sound file
> representation way out of bounds.

Do you start at 0 or 1?
-laz

Sun, 09 Oct 2005 04:59:10 GMT
One more "Giant Canvas" question

Quote:

>> If I use my zoom at all,
>> The graphics will actually redraw again further down the canvas!  I really
>> don't see how that is possible as the math would put the sound file
>> representation way out of bounds.

> Do you start at 0 or 1?
> -laz

I start with 1 and go to 100.  It is strange really.  One of my files when
the zoom is set to 77 and above, it draws really wacky, but 76 and below it
draws correctly.

Joel

Sun, 09 Oct 2005 06:18:46 GMT

 Page 1 of 1 [ 5 post ]

Relevant Pages