Loading System.Drawing.Icon from MemoryStream giving exception
Posted on 2007-10-16
I am using .NET 1.1 with VB.NET. I am attempting to save and load an icon from the database. I have successfully saved the icon to the database (at least I think so) by using the icon class' Save method to write the icon to a stream. I then convert the stream to a byte array and pass that in to a parameter to a sql command. No problem there. But when i try to reload the icon, i get a byte array from the database, assign that to a stream and attempt to use the constructor that takes a stream.
Me.tmpImage = Image.FromStream(strm) 'works just fine.
Me.tmpIcon = New Icon(strm) 'fails
To create the icon, I used Axialis Icon Studio.
Let me know if you need more info.