Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 4355 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

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]

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!