From: Donovan A. <al...@Zo...> - 2006-06-28 01:20:50
|
The method described below is the direction I would take, but treating = it more like a tiled 2d game. =20 In more modern (heh) 2d tile map games, there is a "viewport rectangle" = and a "worldview rectangle". You draw only the viewport rectangle's = tiles, but you store an extra amount of neighboring tiles (the size of = which is more like a worldview). As the viewport is moved, free the = tiles that are now outside of the worldview rectangle and load (in a = thread perhaps?) the new (non-visible) "worldview rectangles". =20 This provides efficient memory use & smoother loading at the cost of = greater complexity & having to break your source image into tiles (which = you do once and save the tiles and a map of coords to the specific = tiles). =20 Anyway, just some more food for thought. If you go this route, there is = plenty of reading out there on this topic for 2d games. =20 ________________________________ From: wxp...@li... on behalf of Jouke = Visser Sent: Tue 6/27/2006 6:37 AM To: Ed W Cc: wxp...@li... Subject: Re: [wxperl-users] Handling a large zoomable image (world map) Hi Ed, > Oooh. I say! Now that looks really nice for all kinds of reasons! > Thanks for creating this My pleasure. If you encounter any bugs, let me know via CPAN's RT. > What's likely the best technique to handle an oversized image with a > small viewport in Image:Magick? I'm guessing that I will have to use = a > static image and some slider bars to emulate the effect of a viewport = on > a much larger sub image? Are there any other useful features in > Image::Magick which can help support the viewport kind of model? Well, you could take the original image, and crop (see the crop method in Image::Magick's documentation) pieces of it and put that in your window. When the user wants to scroll a whole page in any direction (north, east, south or west), you could crop again from the original, and if someone would just want to move in any direction for only a few pixels, maybe it's faster to crop that extra bit and add it to the copy you're already displaying. You can easily "montage" (see IM docs again) several pieces together... Since Wx::Perl::Imagick gives you more image manipulation possibilities, you could also choose to put a kind of compass on top of your image and let the user use that for navigation, or whatever you'd want. I usually get the best ideas for solving my Image manipulation issues by browsing through Image::Magick's documentation (a link to that can be found in the Wx::Perl::Imagick POD), and read what the various methods = do. HTH, Jouke Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ wxperl-users mailing list wxp...@li... https://lists.sourceforge.net/lists/listinfo/wxperl-users |