How to tile a 30000 x 6000 image for a 480 x 320 screen?

前端 未结 2 1058

(this is related to another question about implementation on iPhone)

I have a large image, size around 30000 (w) x 6000 (h) pixels. You may consider it\'s like a big

相关标签:
2条回答
  • 2021-01-15 01:30

    You can use a technique similar to MIP mapping for efficient zooming. In a nutshell, you prepare images that are 1/2, 1/4, 1/8 and so on dimensions of your original image and load/display them according to required zoom level. This will save some scaling computations at the cost of storage space (roughly 1/3 more storage space will be needed).

    As for panning the idea could be to have some tiles preloaded around the visible area. If a user is panning in a particular direction the panning speed could taken into account to preload more tiles in that direction.

    0 讨论(0)
  • 2021-01-15 01:36

    Check out part 3 of Apple's ScrollViewSuite sample code for an example of how to do this.

    0 讨论(0)
提交回复
热议问题