title: Adding Multiple Pictureboxes in C# for the same image source
body: <p>In my application I have over 60 pictureboxes with the same image source added to a panel.</p>
  
  <p><strong>Code Example</strong></p>
  
  <pre><code>class MainForm : Form{
     private Image image = (Image)Resources.myImage;
  
     public MainForm(){
        InitializeComponent();
        initAddImages();
     }
  
     private void initAddImages(){
         for (int i = 0; i &lt; 10; i++)
              for (int j = 0; j &lt; 8; j++){
                  PictureBox p = new PictureBox();
                  p.Image = image;
                  p.SizeMode = PictureBoxSizeMode.Zoom;
  
                  //"ImagePanel" is a TableLayoutPanel
                  imagePanel.Controls.Add(p, i, j);
              }
     }
  
     private void changeImage(){
        image = (Image)Resources.anotherImage;
     }
  }
  </code></pre>
  
  <p><strong>Problems / Questions:</strong></p>
  
  <ol>
  <li><p>The pictureboxes rendering are kinda slow. (I already have a small image resolution). Since the application is re-sizable, the images need to be resized everytime I resize the form. My guess the reason behind this slowness in rendering is caused because the images size needs to be calculated for ever single picturebox. Is there way to resize the image once and force all pictureboxes to use this resized image ?</p></li>
  <li><p>Is it possible to pass the image object reference to all pictureboxes objects so when I change the image resource reference (by calling for example "changeImage"), all pictureboxes will be rendered with the new image "anotherImage"?</p></li>
  </ol>
  
  <p>Thanks in Advance ...</p>