FileStream GURU Help - Filestream and Icon files .NET SQL2000

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")
 
C

Cor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top