Results 1 to 8 of 8

Thread: [RESOLVED] Icon -> ByteArray -> Icon

Threaded View

  1. #4
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [2005] Icon -> ByteArray -> Icon

    Have you tried this code?
    VB Code:
    1. Public Function GetByteArrayFromIcon(ByVal icoSource As Icon) As Byte()
    2.         Dim byteArray As Byte()
    3.         Using msIcon As New System.IO.MemoryStream
    4.             icoSource.Save(msIcon)
    5.             byteArray = msIcon.ToArray
    6.         End Using
    7.         Return byteArray
    8.     End Function
    9.  
    10.     Public Function GetIconFromByteArray(ByVal bytSource As Byte()) As Icon
    11.         Using msIcon As New IO.MemoryStream(bytSource)
    12.             Dim myIcon As New Icon(msIcon)
    13.             Return myIcon
    14.         End Using
    15.         Return Nothing
    16.     End Function
    Edit**

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width