I seem to be having a lot of trouble solving this one. I have a typical view/model/controller set-up. The view is part of an application window and has scroll bars. It needs to display (the visible part of) a large map (up to 3200 pixels square) and scroll around to reveal the invisible parts.
I assemble the map by drawing shapes on a Pixmap's GraphicsContext. I then display that on the View's GraphicsContext. Unfortunately, the GC is never any larger than my screen resolution, so I can only scroll around the area 1024x768 top left. I can display the pixmap at a negative offset, so revealing a different rectangle, but it will still only scroll around a 1024x768 area. Also, that messes up the coordinates for point-and-click placement of objects. How would I obtain a display surface larger than the default screen GC? Or do I have to combine multiple sections? VWNC7.4.1 Windows Vista. |
Just a resend for the list. In the meantime, I published a new version
of GHFractalExplorer, which no longer tries to load old MacOS 9 stuff. I tested it on VW7.6, and unfortunately, the fast Mandelbrot implementation in C does not work on Intel-MacOSX :-( Hi Trium, Please have a look at the GHFractalExplorer in the public repository. The oal of the application is to draw Mandelbrod-Sets and alike with VisualWorks. One side of the app is to create very large pictures of such sets, and so there is an MVC-hierarchy of controllers and views in there, which do what you desire: display a large Pixmap, and scroll arround. Look at: IterativeGraphicsPart openExtraLarge The solution may not fit completely for your application, but feel free to take a deep look;-) Good Luck Roland Wagener -- Roland Wagener * Senior Consultant * [hidden email] Tel: x49-231-9 75 99-26 Fax: x49-231-9 75 99-20 Georg Heeg eK Dortmund Handelsregister: Amtsgericht Dortmund A 12812 Trium schrieb: > I seem to be having a lot of trouble solving this one. I have a typical > view/model/controller set-up. The view is part of an application window and > has scroll bars. It needs to display (the visible part of) a large map (up > to 3200 pixels square) and scroll around to reveal the invisible parts. > > I assemble the map by drawing shapes on a Pixmap's GraphicsContext. I then > display that on the View's GraphicsContext. Unfortunately, the GC is never > any larger than my screen resolution, so I can only scroll around the area > 1024x768 top left. > > I can display the pixmap at a negative offset, so revealing a different > rectangle, but it will still only scroll around a 1024x768 area. Also, that > messes up the coordinates for point-and-click placement of objects. > > How would I obtain a display surface larger than the default screen GC? Or > do I have to combine multiple sections? > > VWNC7.4.1 Windows Vista. vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Trium
Am 02.07.2008 um 19:13 schrieb Trium: > I assemble the map by drawing shapes on a Pixmap's GraphicsContext. Unless you need to use a Pixmap for a special purpose, you could as well do without it. Just draw your shapes to the window GC in your #displayOn: method and have your window use the double-buffer display policy. It will do the buffering for you. I'm using very populated graphics with a couple thousand objects on a timeline spanning up to 100,000 pixels of width. Querying the GC's clipping bounds helps to avoid drawing the invisible parts (skip everything outside bounds plus a little padding for scroll updates). After all, it's fast enough even for thumb scrolling. Andre _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Try to implement something like this in your View
preferredBounds "Answer the preferred bounds of the receiver." ^0@0 extent: 4000@6000 @+Maarten, Andre Schnoor a écrit : Am 02.07.2008 um 19:13 schrieb Trium:I assemble the map by drawing shapes on a Pixmap's GraphicsContext.Unless you need to use a Pixmap for a special purpose, you could as well do without it. Just draw your shapes to the window GC in your #displayOn: method and have your window use the double-buffer display policy. It will do the buffering for you. I'm using very populated graphics with a couple thousand objects on a timeline spanning up to 100,000 pixels of width. Querying the GC's clipping bounds helps to avoid drawing the invisible parts (skip everything outside bounds plus a little padding for scroll updates). After all, it's fast enough even for thumb scrolling. Andre _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Many thanks all - following Maarten's tip I just get my file-opening routine to let the view know how big the map is and override the 'preferredBounds' method accordingly. No problems with view-to-model coordinate translation either. Works a treat. Now I just have to weed out all those places I was using translation!
Date: Thu, 3 Jul 2008 23:16:00 +0200 From: [hidden email] CC: [hidden email] Subject: Re: [vwnc] Displaying large graphics Try to implement something like this in your View preferredBounds "Answer the preferred bounds of the receiver." ^0@0 extent: 4000@6000 @+Maarten, Andre Schnoor a écrit : Am 02.07.2008 um 19:13 schrieb Trium:I assemble the map by drawing shapes on a Pixmap's GraphicsContext.Unless you need to use a Pixmap for a special purpose, you could as well do without it. Just draw your shapes to the window GC in your #displayOn: method and have your window use the double-buffer display policy. It will do the buffering for you. I'm using very populated graphics with a couple thousand objects on a timeline spanning up to 100,000 pixels of width. Querying the GC's clipping bounds helps to avoid drawing the invisible parts (skip everything outside bounds plus a little padding for scroll updates). After all, it's fast enough even for thumb scrolling. Andre _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc Get Hotmail on your Mobile! Try it Now! _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |