• Advertisement
Sign in to follow this  

[.net] using a picturebox to display clipped images

This topic is 4147 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement