B
Bob
The code below gives me an "Out of Memory" exeption when the
PictureBox1 is assigned. If I use the same code but relpace the
CIRC.ICO with a Test.JPG file it works! Is there something special
about .ico files? Suggestions?
Thank
Bob
Dim fs As New FileStream("c:\CIRC.ICO", FileMode.Open,
FileAccess.Read)
Dim br As New BinaryReader(fs)
Dim mImageArray() As Byte = br.ReadBytes(CInt(fs.Length - 1))
br.Close()
Dim fs2 As New FileStream("c:\My.ico",
FileMode.OpenOrCreate,fileAccess.Write)
Dim bw As New BinaryWriter(fs2)
bw.Write(mImageArray)
bw.Flush()
bw.Close()
PictureBox1.Image = Image.FromFile("c:\My.ico")
PictureBox1 is assigned. If I use the same code but relpace the
CIRC.ICO with a Test.JPG file it works! Is there something special
about .ico files? Suggestions?
Thank
Bob
Dim fs As New FileStream("c:\CIRC.ICO", FileMode.Open,
FileAccess.Read)
Dim br As New BinaryReader(fs)
Dim mImageArray() As Byte = br.ReadBytes(CInt(fs.Length - 1))
br.Close()
Dim fs2 As New FileStream("c:\My.ico",
FileMode.OpenOrCreate,fileAccess.Write)
Dim bw As New BinaryWriter(fs2)
bw.Write(mImageArray)
bw.Flush()
bw.Close()
PictureBox1.Image = Image.FromFile("c:\My.ico")