I cannot figure out why I am getting a null ref in the this. The path to the image is correct. The value of the rectangle size is not missing. Any idease?
Sub New()
InitializeComponent()
Canvas = New Bitmap(Me.PictureBox1.Width, Me.PictureBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(canvas)
g.DrawImage(Image.FromFile("C:\windows\gone fishing.bmp"), New Rectangle(0, 0, canvas.Width, canvas.Height)) '''Errors here, Null Ref
g.Dispose()
End Sub
Sub New()
InitializeComponent()
Canvas = New Bitmap(Me.PictureBox1.Width, Me.PictureBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(canvas)
g.DrawImage(Image.FromFile("C:\windows\gone fishing.bmp"), New Rectangle(0, 0, canvas.Width, canvas.Height)) '''Errors here, Null Ref
g.Dispose()
End Sub