|
-
Apr 23rd, 2004, 04:00 PM
#1
Thread Starter
Hyperactive Member
What the ****, memorystream question.
Here is my code, the Pos1 - Pos6 objects are Pictureboxes. They all contain pictures that I want to send to a dataset, before I can do that I have to save them to memorystream variables...
When I run this code I get the following error...
An unhandled exception of type 'System.ArgumentNullException' occurred in system.drawing.dll
Additional information: Value cannot be null.
I don't know what to do because the value of the pictureboxes is definately not null. I can verfiy that through the command window in debug mode. It tells me that it is a valid bitmap object. Any advice would be much appreciated.
Code:
Dim Image1 As IO.MemoryStream
Dim Image2 As IO.MemoryStream
Dim Image3 As IO.MemoryStream
Dim Image4 As IO.MemoryStream
Dim Image5 As IO.MemoryStream
Dim Image6 As IO.MemoryStream
Pos1.Image.Save(Image1, System.Drawing.Imaging.ImageFormat.Bmp)
Pos2.Image.Save(Image2, System.Drawing.Imaging.ImageFormat.Bmp)
Pos3.Image.Save(Image3, System.Drawing.Imaging.ImageFormat.Bmp)
Pos4.Image.Save(Image4, System.Drawing.Imaging.ImageFormat.Bmp)
Pos5.Image.Save(Image5, System.Drawing.Imaging.ImageFormat.Bmp)
Pos6.Image.Save(Image6, System.Drawing.Imaging.ImageFormat.Bmp)
-
Apr 23rd, 2004, 04:26 PM
#2
Hmm. Not sure, but I think you need to change you Dim statement.
Try Dim ImageX As NEW IO.MemoryStream
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Apr 26th, 2004, 11:35 AM
#3
Thread Starter
Hyperactive Member
Well, that was embarassing. One of those days when you have been working too long to catch the obvious. Thanks for the second set of eyes.
-
Apr 26th, 2004, 01:51 PM
#4
Is there still an issue with late binding like that in VB.net?
VB6 used to be slower with late binding.
dim x as thingy = new thingy 'early binding good 
dim x as new thingy 'late binding bad
I don't live here any more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|