Emptying out an Image Variable

  • Thread starter Thread starter jcrouse
  • Start date Start date
Hi,

Is this what you mean?

Dim bm As New Bitmap(100, 100)
Dim g As Graphics = Graphics.FromImage(bm)

g.Clear(Color.White)
g.Dispose()

Ken
------------------
 
* "jcrouse said:
How do you empty the contents of a variable the contains an image?

Are you talking about a variable of type 'Image'? For exmptying the
variable, set it to 'Nothing'. If you want to destory the object
referenced in the variable, call its 'Dispose' method and assign another
reference or a reference to 'Nothing' to the variable if it's reused
later in the method.
 
More......Here is what I have.

On form1:
Public imgCockTailStyle as Image

On form2:
imgCockTailStyle = pbCTS.Image

Now, when I attempt to enter this code on form2:

form1.imgCockTailStyle is Nothing

It underlines "form2.imgCockTailStyle" and it also underlines "is". The
three errors are

Expression expected.
Expression is not a method.
Method arguments must be enclosed in parentheses.
 
Back
Top