I have this code which creates a picturebox during runtime and displays line graph but I always get an error in this line:

gr1.DrawImage(pic1.Image, -m_Dx, 0) 'it says Value cannot be null. Parameter name: image

code Code:
  1. Public Class Form1
  2.     Private Const m_Dx As Single = 1
  3.     Dim data As Integer = 1
  4.  
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         Dim pic1 As New PictureBox
  7.         pic1.Location = New Point(12, 12)
  8.         pic1.Name = "pic1"
  9.         pic1.Width = 142
  10.         pic1.Height = 102
  11.         pic1.Visible = True
  12.         pic1.BackColor = Color.Black
  13.         pic1.BorderStyle = BorderStyle.Fixed3D
  14.  
  15.         Controls.Add(pic1)
  16.  
  17.         Dim bm1 As New Bitmap(pic1.Width, pic1.Height)
  18.         Dim gr1 As Graphics = Graphics.FromImage(bm1)
  19.         gr1.DrawImage(pic1.Image, -m_Dx, 0)
  20.  
  21.         gr1.ScaleTransform(1, -101 / pic1.Height)
  22.         gr1.TranslateTransform(0, -101)
  23.  
  24.         Dim new_value1 As Integer = Val(data) / 2
  25.  
  26.         If new_value1 < 1 Then new_value1 = 1
  27.         gr1.DrawLine(Pens.Blue, _
  28.             pic1.Width - 1, 0, _
  29.             pic1.Width - 1, new_value1)
  30.  
  31.         For i As Integer = 20 To 80 Step 20
  32.             gr1.DrawLine(Pens.Red, pic1.Width - m_Dx, i, pic1.Width, i)
  33.         Next i
  34.  
  35.         pic1.Image = bm1
  36.  
  37.     End Sub
  38.  
  39.     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  40.         data = data + 1
  41.     End Sub
  42. End Class

Did I miss something?