I’m working on a class that will help me read a game file, and part of the file is an image. Is there an image object that I can create from a byte array, or should I just store the image as a byte array? If I were to put that image into a picture displayer in winforms, can I do that with a byte array?
What’s the best way to store the data from the file?
like this:
to answer the other part of your question, it is fine to store it as a byte array – maybe provide a helper method that returns a memory stream as seen above, or alternatively store it in a
System.Drawing.Bitmapand return that: