This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Rendering Large Images Fast  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to develop an application for use on cell phones that will be able to render a large image fast. By large, I mean something like a 40 MB PNG file that represents a map of an area, something around 18000x15000 pixels. This is even slow on a modern computer if done incorrectly (Photoshop is one of the few programs that can render such images fast), so I need to find a way to quickly paint the portion of the image that the user needs to see, with no more resolution or area than needed. (This may involve cropping and then converting the image to a bitmap of the needed size, but the issue here is a speed that the user can bear to live with.) I'm not sure where to start, since the Graphics API doesn't seem to be capable of doing this... can anybody help?

Thank you!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may use quadtree to store images. Images must be dynamically loaded from rms or filesystem as they are painted. On the most phones you can keep in ram some 500 x 500 px image. So the resolution would be to crop your image on many 50 x 50 parts and put them in quadtree. If you can't find quadtree implementation i could share the one i used if you need it.
I had the very same problem some time ago, i resolved it in this way.
 
Saloon Keeper
Posts: 19267
85
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an open-source web server product called Ka-Maps! that can tile like Google Maps does. It includes a "zoom" facility and a set of caches. No special code is required in the client other than basic JavcaScript capabilities.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!