Iphone tiling picture

I have a 1280 x 1664 image, and I want to use the ScrollViewSuite example that Apple gives us, but I need to reduce this image to several zoom levels.

So, does anyone know how I can draw an image with several zoom levels. Should there be an easy way to deliver an image up to 256x256 without manually cutting it with Photoshop?

+3
iphone tiles
Jul 14 2018-10-14T00:
source share
4 answers

great find. I did a bit of work on what you found, and I managed to add the line and col to the output file name. I also resized the image, by what percentage do I want the image to be. Therefore, I can now do all this from one large image.

convert bigimage.png -resize 25% -crop 256x256 -set filename:tile "%[fx:page.x/256+1]_%[fx:page.y/256+1]" +repage +adjoin "tile_25_%[filename:tile].png" 

Thanks for helping me, it saved me a lot of time. I hope I helped you?

+5
Jul 14 '10 at 15:30
source share

Funny - I went to bed last night, knowing that this was the first thing I would have to endure this morning. I just found a wonderful solution. ImageMagick out of the box using conversion with the -crop option:

convert bigimage.png -crop 256x256 tile.png

This makes as many tile files as necessary, and, most importantly, creates rectangles on the right side and bottom. All the other solutions that I investigated made n, m uniformly sized plates from the image.

Tiles are numbered with tiles - ##. png, where ## starts from zero. I would prefer -row # -col # .png, but this will work for me. CATiledLayer, here I come.

+4
Jul 14 2018-10-14T00:
source share
+1
May 01 '11 at 13:16
source share

You can also use the gdal2Tiles utility, which is especially effective for creating map overlay overlays from a large input image.

Find "gdal2tiles" here at StackOverflow, and be sure to check out the Apple TileMap sample code. TileMap is available through WWDC 2010 Sample Download (free).

0
Dec 11 '10 at 15:05
source share



All Articles