I need to store and retrieve icons in my database (SQL Server 2000, Image field). I have a function to convert the icon to a byte array so it can be stored in the database:
But I'm having trouble converting a byte array back into an icon. I've got this so far...but how do I complete it?VB Code:
Public Function GetByteArrayFromIcon(ByVal icoSource As Icon) As Byte() Dim msIcon As System.IO.MemoryStream msIcon = New System.IO.MemoryStream icoSource.Save(msIcon) Return msIcon.ToArray End Function
VB Code:
Public Function GetIconFromByteArray(ByVal bytSource As Byte()) As Icon Dim msIcon As System.IO.MemoryStream msIcon = New System.IO.MemoryStream(bytSource) Return ????? End Function





Reply With Quote