Simple MemoryStream and Image Problem - CLUES??

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I am having trouble with MemoryStream....

Dim Im As Image
Im = Im.FromFile("C:\smallphoto.Bmp")

Dim ms As MemoryStream = New MemoryStream

Im.Save(ms, Imaging.ImageFormat.Bmp)

.... I get "Value cannot be null." error on the last line.

Suggestions?

Thanks
Bob
 
Bob

The reason why you're getting an exception is because you haven't instantiated the ms object. Try

Dim ms as New MemoryStrea

Paul K
 
Back
Top