In C #, sometimes to solve the problem of displaying several pictures, such as with a background image, there has been a picture to be displayed on a background map, how to put it on two synthetic images show a picture of it?
The following example provides a method to solve such a code is as follows:
// strwinepath wine picture
// strBackPic background image
private void TestPaint(string strwinepath,string strWineDetailBackPic)
{
// Get the picture of wine, wine picture format is jpg format
Image imgWine = Image.FromFile(strwinepath);
// Get the background picture, background picture format is jpg format also now read as bmp format
Bitmap bmp = new Bitmap (strBackPic) ;
Get background of the drawing surface of FIG
Graphics g = Graphics.FromImage (bmp);
// The liquor drawn onto the background image
g.DrawImage (imgWine, 149, 209,100,416) ;
// display the background image is loaded onto the background
this.BackgroundImage = BMP;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
}
Reproduced in: https: //www.cnblogs.com/kevinGao/archive/2011/12/19/2294467.html