The main reason is that the original type of the uploaded image is GIF, so you must first map the original image, and then save the bitmap.
/// <Summary>
/// Add a watermark to the image
/// </Summary>
/// <Param name = "strpath"> original file </param>
/// <Param name = "strpathsyp"> watermark file </param>
/// <Param name = "strpathsypf"> watermark result file </param>
Public static void addwaterpic (string strpath, string strpathsyp, string strpathsypf)
{
System. Drawing. Image image = system. Drawing. image. fromfile (strpath );
Bitmap Bm = new Bitmap (image );
System. Drawing. Image copyimage = system. Drawing. image. fromfile (strpathsyp );
System. Drawing. Graphics G = system. Drawing. Graphics. fromimage (BM );
// If You Want to center the watermark, you only need to change the values of BM. Width-copyimage. Width and BM. Height-copyimage. Height.
// You can use convert. toint32 (image. Width * 0.3), convert. toint32 (image. Height * 0.3)
G. drawimage (copyimage, new system. drawing. rectangle (BM. width-copyimage. width, BM. height-copyimage. height, copyimage. width, copyimage. height), 0, 0, copyimage. width, copyimage. height, system. drawing. graphicsunit. pixel );
G. Dispose ();
Copyimage. Dispose ();
BM. Save (strpathsypf );
BM. Dispose ();
}