Break an Image into smaller parts and save them as different images


(Elias) #1

Hello everyone!

As the title says, is it possible to break an image into parts and then save the parts as different images?


(Bora Kasap) #2

I think you’re looking for Canvas class, http://useflashpunk.net/docs/net/flashpunk/graphics/Canvas.html

But i haven’t tried it before, also don’t know about saving as files… So, thats just a quick answer to give you an idea…


(Ssnyder Coder) #3

To do this ingame, utilizing the Canvas class’s draw() or copyPixels() methods would be the way to go.

If you want to actually save the broken up images as separate image files, then you’ll need to instead work with the actual BitmapData class. You can use BitmapData’s copyPixels() method in basically the same way as the Canvas’s version. The as3corelib has the image file saving functionality you would need.