FileStream GURU Help - Filestream and Icon files .NET SQL2000

  • Thread starter Thread starter Bob
  • Start date Start date
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")
 
Hi Bob,

I as far as I know is a Ico file not a bitmap in dotNet.

If you want to know more of that I would ask it in this newsgroup too.

microsoft.dotnet.framework.drawings

I hope this helps?

Cor
 
Back
Top