[.net] using a picturebox to display clipped images
Essentially I'm making a sprite editing program, where I can take a long sprite strip and input animation information to be used in my games. I'm having a really difficult time doing the simple clipping of images. I want to be able to load an image and then have it display the frames in a box. For now, I'm just going with 64x64 for the size of each frame. What a simple way I can crop an image object (or whatever) and display just part of it in the picture box?
There isn't a completely simple way to do this. You'll probably want to use GDI+ to accomplish this. Basically you have to create a graphics object from the picturebox's image property, then use that graphics object to draw your sprite specifying a source rectangle to only draw the portion of the sprite you want.
I would start here: http://msdn2.microsoft.com/en-us/library/e06tc8a5.aspx
I would start here: http://msdn2.microsoft.com/en-us/library/e06tc8a5.aspx
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement