Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Solutions to that problem might be various, and it mainly depends on your skills and amount of work will depend on kind of images you're dealing with. For example if images are always same resolution, size and overlapping image supports transparency you could try to do manipulation of two <code>Image</code> objects and draw one over another, then display it in <code>PictureBox</code>. Or if you will need to do it multiple times in various places of your app you could even consider creating your own <code>UserContriol</code>.</p> <p>Code in answer of <a href="https://stackoverflow.com/questions/249587/high-quality-image-scaling-c">this question</a>, method <code>ResizeImage</code>in particular, show how to create resized, good quality image, all you need it is to change it a little. Make it to get two <code>Images</code> as input parameters, and change it to draw one image over another.</p> <p>Changes might look like this </p> <pre><code> public static Bitmap CombineAndResizeTwoImages(Image image1, Image image2, int width, int height) { //a holder for the result Bitmap result = new Bitmap(width, height); //use a graphics object to draw the resized image into the bitmap using (Graphics graphics = Graphics.FromImage(result)) { //set the resize quality modes to high quality graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; //draw the images into the target bitmap graphics.DrawImage(image1, 0, 0, result.Width, result.Height); graphics.DrawImage(image2, 0, 0, result.Width, result.Height); } //return the resulting bitmap return result; } </code></pre> <p>And use it, for example, like this:</p> <pre><code> pictureBox1.Image = CombineAndResizeTwoImages(Image.FromFile("c:\\a.png"), Image.FromFile("c:\\b.png"), 100,100); </code></pre> <p>But that its only example, and you must tune it up to your needs. Good luck.</p>
 

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