title: How do I get the color of a specific pixel from a picture box?
body: <p>I have a picture box in one of my programs which displays my images just fine. What's displayed consists of a chosen "BackColor" and some filled rectangles using a brush and some lines using a pen. I have no imported images. I need to retrieve the color value of a specified pixel on the picture box. I've tried the following:</p>
  
  <pre><code>Bitmap b = new Bitmap(pictureBox1.Image);          
                  Color colour = b.GetPixel(X,Y)
  </code></pre>
  
  <p>But <code>pictureBox1.Image</code> always returns <code>null</code>. Does <code>.Image</code> only work with imported images? If not how can  I get this to work? Are there any alternatives?</p>