I am sorry that this is a little bit ambiguous. I am having an issue using System.Drawing in XNA; from my research it is not available to XNA (since its part of the windows.dll?)
I want to create a sprite sheet analyzer which automatically dissembles a sprite sheet into its proper segmentation, number of frames, etc. for later playback. For this I need to grab the actual PNG file and it would be nice to have something that already has the functionality for working with images. Is there a class in XNA which provides similar functionality as System.drawing?
You can use
System.Drawingin conjuction with XNA with no problem — you just have to add a reference to it in your XNA project. However,System.Drawingdoes not support loading of .pngs, while XNA does.The usual way to load images in XNA is to first add them to your content project (usually when you create an XNA project there is always a corresponding content project created). Add the saved .png to your content project and give it a unique name. Then in your code, load the image as a
Texture2D:Note the use of
Contentwhich is aContentManagerobject that can be referenced from theGameobject you are currently using for your XNA game.Check this out for more information.