Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A very simple and straight forward solution exists, has been thought of by Microsoft and includes these steps:</p> <ul> <li>Instead of <code>PictureBox</code> use a <code>Panel</code> and instead of using the <code>Image</code> property of the <code>PictureBox</code> use the <code>BackgroundImage</code> property of the <code>Panel</code></li> </ul> <p><strong>note:</strong> By using also the <code>BackgroundImageLayout</code> property you can quite easily instruct the <code>Panel</code> to <em>stretch</em>, <em>center</em> or <em>zoom</em> the image (I'm presuming the default value which is <em>tile</em> is not a good option in your case)</p> <ul> <li>Instead of placing the other user controls at higher Z order but alongside the previous <code>PictureBox</code> place them inside the <code>Panel</code></li> <li><p>Use the <code>Control.DrawToBitmap</code> method like so:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { var bmp = new Bitmap(this.panel1.Width, this.panel1.Height); this.panel1.DrawToBitmap(bmp, new Rectangle(Point.Empty, bmp.Size)); bmp.Save(@"D:\test.png", ImageFormat.Png); } </code></pre></li> </ul> <p>That will result in your controls begin rendered along with the picture:</p> <p><img src="https://i.stack.imgur.com/q6t0p.png" alt="enter image description here"></p> <p>Furthermore, and if your scenario allows it, you could simply use the <code>DrawToBitmap</code> method with any control which contains all of the actors you wish to render, for instance the actual <code>Form</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload