Jump to content
  • Advertisement
Sign in to follow this  
kavitha

zoom-in/zoom-out feature

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey folks, i have written a small image viewer to view images of different formats. I was fascinated in looking @ google's way of showing maps and particularly their zoom-in/zoom-out feature. similarly, i would like to add that into my program too. any inputs on how it could be done ?. kavitha

Share this post


Link to post
Share on other sites
Advertisement
Not entirely sure how the maps on Google do it, but I think it might just be satellite photos taken with a various level of zoom on them. When you zoom in, I would just display the same position, centered, and bring in the next zoom level of images.

Share this post


Link to post
Share on other sites
If your drawing code is fast enough you can simply zoom in and out. The reason Google did it that way with Google maps is because you are downloading tiles from the interweb and you don't want just a blank screen while that happens. Also, the scaled bitmap gives you a rough idea of where you are zooming in to.

This is simply a case of taking a screenshot before you zoom (or using your offscreen bitmap if you're doing things nicely). When you start zooming, set a timer for a reasonable time to wait before redrawing. This timer will be reset each time you zoom so that if you zoom lots and your drawing code is slow, you are not waiting for the software to catch up.

Then you simply scale the bitmap and draw it. Once the timer event is raised you redraw the window with the proper content instead of the scaled bitmap.

Share this post


Link to post
Share on other sites
-if i understand well- calculate the mipmaps of the image and when zoom is not high use them. also cut down the image to smaller subsets. you can make a simple frustum test for them(it is in 2D, so just test view size and images like aabb s) this will increase the perfomance for big images.

Share this post


Link to post
Share on other sites
I have written my viewer in C++ using different image libraries for jpeg, dds, rgb etc.

.kavitha

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!