[.net] [solved] Problem loading Bitmaps from Stream

Started by
-1 comments, last by Scet 17 years, 8 months ago
Hello, I'm working a file format that for now consists of several Bitmap objects all saved to the same file. I'm simply saving them using Bitmap.Save( Stream, Format ), where Stream is a FileStream and Format is ImageFormat.Bmp. I even checked the stream position before loading and it is indeed correct. However I keep getting System.ArgumentException. I did a little experiment and found that when just saving one image and nothing else, it works. However when adding the header it throws the exception, and yes I did read past the header to the start of the image data. So I'm lead to believe that this Bitmap constructor resets the stream position to 0. Does anyone have any idea why it's acting this way? I need to figure this out or I'll have to output pixel by pixel which really sucks. Thank you for any help. Edit: Nevermind, I've figured out a solution of just saving/loading the Bitmap to a MemoryStream and then saving/loading the MemoryStream. [Edited by - Scet on August 20, 2006 5:58:40 PM]

This topic is closed to new replies.

Advertisement