IOS big image loading and cutting

Source: Internet
Author: User

When developing cocos-2d, I learned some knowledge:

On iOS, the image is automatically scaled to the Npower of 2. For example, a 1024*1025 image occupies the same memory as a 1024*2048 image. The formula for calculating the memory used by the image is: length * width * 4. In this case, the memory occupied by 512*512 is 512*512*4 = 1 m. Other dimensions, and so on. (PS: the maximum size supported on iOS is 2048*2048 ).

Native SDK development provides some solutions for pasting large charts, including photoscroll and scrollviewsuite code.

The image Cutting Tool https://github.com/jlamarche/tile-cutter.

The image cropping method of imagemagic is similar to that of photoscroll. The command is as follows:

Convert bigimage.png-crop 256x256-set filename: tile "% [FX: page. */256 + 1] _ % [FX: page. y/256 + 1] "+ repage + adjoin" tile_25 _ % [filename: tileapps.png"

Add the parameter-resize 25% when scaling is required.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.