Hi, experts -
I'm sure I'm just missing something ridiculously simple. I'm drawing a character in a picturebox, using Graphics objects associated with 2 pictureboxes (PB and PB2). After the character is drawn, I'm trying to put the picturebox image into an imagelist control. The imagelist is supposed to take an image of type "System.Drawing.Image" - which is what the picture box image should be (I assume). Yet in the line that is "IList1A.Images.Add (PB.Image)", I get an error saying that "Value can not be null" for PB.Image.
I just got through writing pixels on the bitmap of the PB, I don't see where it should be null. Can someone tell me what I'm doing wrong?
Dim g As Graphics = System.Drawing.Graphics.FromHwnd(PB.Handle)
Dim g1 As Graphics = System.Drawing.Graphics.FromHwnd(PB2.Handle)
For i = 1 To CellWidth
For l = Pointer1 + 1 To Pointer1 + 1 + CellHeight
'draw the '1's' as black
If Mid$(CellString(i), l, 1) = "1" Then
g.DrawEllipse(Pens.Black, i - 1, CellHeight - (l - Pointer1), 1, 1)
g1.DrawEllipse(Pens.Black, i - 1, CellHeight - (l - Pointer1), 1, 1)
g.DrawEllipse(Pens.Khaki, i - 1, CellHeight - (l - Pointer1), 1, 1)
g1.DrawEllipse(Pens.DarkKhaki, i - 1, CellHeight - (l - Pointer1), 1, 1)
ICount = ICount + 1
If j = 0 Then