Results 1 to 8 of 8

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

Hybrid View

  1. #1
    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**

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840

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

    Quote Originally Posted by VBDT
    Have you tried this code?
    VB Code:
    1. ...
    2.             Dim myIcon As New Icon(msIcon)
    3. ...
    I can't believe I totally missed the constuctor

    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

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

    Did this solve the alpha info in the icon.
    And what did you do to get the icon path... where in code is this set?


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