0

I'm trying to get a single image out of this massive file with other images in it and don't want to have to photoshop them out individually.

Can I use some sort of code segment to only display the one I need at the time.

This is one of the images I'm trying to use

enter image description here

Mahendra Gunawardena
  • 1,956
  • 5
  • 26
  • 45
  • Do you need *one* "sub-image"? Do you need a "set" of images? Do you need them as "sprites"? Depending on what you really want to do, you can do these tasks with `CGImageCreateWithImageInRect`, or look into `SpriteKit`. You can find many examples by searching for `get portion of uiimage` – DonMag Jun 03 '17 at 22:29
  • I'd recommend you develop a clear understanding of the `UIView` properties `frame` and `bounds`, by reading the Apple documentation and [SO questions such as this](https://stackoverflow.com/questions/1210047/cocoa-whats-the-difference-between-the-frame-and-the-bounds). Once you understand that, you should be able to create a `UIImageView` from your `UIImage` and then arithmetically iterate through the smaller images within the image file using a bounds the size of the individual image. – andrewbuilder Jun 04 '17 at 01:30
  • This question is too broad, please read https://stackoverflow.com/help/how-to-ask, It would be helpful to have some kind of code of what you have tried, otherwise it's hard to point to a specific solution. This post might help you to get into some code https://www.raywenderlich.com/145318/spritekit-swift-3-tutorial-beginners – nramirez Jun 09 '17 at 20:52

0 Answers0