I want to merge two .png images
<p>I want to merge two .png images. but when I ga to save them there occurred an error called a generic error occurred in gdi+. I want to continue my project as soon as possible. please help me. Thanks</p>

<pre><code>private void MergeImages(string ImageBack,string ImageFore)
        {
            try
            {
            System.Drawing.Graphics myGraphic = null;
        Image imgB;// =new Image.FromFile(ImageBack);
        imgB = Image.FromFile(ImageBack);
            //FileInfo fileInfoBack = new FileInfo(ImageBack);

        Image imgF;// =new Image.FromFile(ImageBack);
        imgF = Image.FromFile(ImageFore);
        //Bitmap tempBitmap = new Bitmap(imgB.Width, imgB.Height,imgB.PixelFormat );
          //  tempBitmap.Save("a"+fileInfoBack.Extension);

        Image m;
        m = Image.FromFile(ImageBack);
      //  m = Image.FromFile("a" + fileInfoBack.Extension);
        myGraphic = System.Drawing.Graphics.FromImage(m);
        myGraphic.DrawImageUnscaled(imgB,0,0);
        myGraphic.DrawImageUnscaled(imgF,posX,posY);
        myGraphic.Save();


        m.Save(ImageBack.Replace(".jpg",".jpeg"),System.Drawing.Imaging.ImageFormat.Jpeg);
        //m.Save(ImageBack, System.Drawing.Imaging.ImageFormat.Png);
      // m.Save("d.png", System.Drawing.Imaging.ImageFormat.Png);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }

    }

    private void btnFileProtector_Click(object sender, System.EventArgs e)
    {
        if (openFileDialog1.ShowDialog()==DialogResult.OK)
        {
            txtFileProtector.Text=openFileDialog1.FileName;
        }
    }

    private void btnFilesToProtect_Click(object sender, System.EventArgs e)
    {
        listFilesToProtect.Items.Clear();
        if (openFileDialog2.ShowDialog()==DialogResult.OK)
        {
            if (openFileDialog2.FileNames.Length&gt;0)
            {
                for(int i=0;i&lt;openFileDialog2.FileNames.Length;i++)
                {
                    listFilesToProtect.Items.Add(openFileDialog2.FileNames[i]);
                }
            }
        }
    }

    private void btnLoad2_Click(object sender, System.EventArgs e)
    {
        posX = int.Parse(textBox1.Text);
        posY = int.Parse(textBox2.Text);
       // heightBackImage = int.Parse(textBox3.Text);
       // widthBackImage = int.Parse(textBox4.Text);

        if (listFilesToProtect.Items.Count&gt;0)
        {
            foreach(object it in listFilesToProtect.Items)
            {
                MergeImages(it.ToString(), txtFileProtector.Text);

            }
        }
    }
</code></pre>
