Private byte[] Putlogoinimage (image commodityimage, image priceimage, string activeprice, bool Checked11, imag
e brandlogoimage = null) {byte[] result = NULL;
Image im = Commodityimage; using (Image mypriceimage = Priceimage.clone () as Image) {logopriceimage (Mypriceimage, active
Price, CHECKED11); Create a brush using (Graphics g = graphics.fromimage (IM)) {G.interpolationmo
de = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
G.pixeloffsetmode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
g.compositingquality = System.Drawing.Drawing2D.CompositingQuality.Default;
if (brandlogoimage!= null) {using (Bitmap BM = new Bitmap (brandlogoimage))
{//hit upper left corner G.drawimage (BM, new System.Drawing.Rectangle (0, 0, BM.) Width, BM. Height), 0, 0, BM. Width, BM.
Height, GraphicsUnit.Pixel);
The using (Bitmap BM = new Bitmap (mypriceimage)) { #region thumbnail//var tempimg= BM.
Getthumbnailimage ((), INTPTR, NULL, New ()); G.drawimage (tempimg, new Rectangle (IM). Width-tempimg.width, im.
Height-tempimg.height, Tempimg.width, tempimg.height)); #endregion//BM. Maketransparent (Color.White); Comment out, otherwise the bottom chart will have an effect on the icon ZHJW 20151102//hit to the lower right corner of G.drawimage (BM, new Rectangle (IM.W IDTH-BM. Width, im. HEIGHT-BM. Height, BM. Width, BM.
Height));
}///will save the picture byte[] using (MemoryStream ms = new MemoryStream ()) {using (Bitmap BMP = new Bitmap (IM))//must create a new object {var ici
= Getimageencoder (IM); if (ici = null) {BMP. Save (MS, im.
Rawformat);
else {using (var EP = new EncoderParameters {Param = new encoderparameter[] {new encoderpa
Rameter (System.Drawing.Imaging.Encoder.Quality, 100L)}}) { Bmp.
Save (MS, ICI, EP); result = Ms.
ToArray ();
} return result; private static ImageCodecInfo Getimageencoder (Image img) {//Critical quality control//Get the number of system encoding types
Group that contains the Jpeg,bmp,png,gif,tiffvar icis = Imagecodecinfo.getimageencoders ();
ImageCodecInfo ici = null; foreach (ImageCodecInfo i in ICIS) {if (IMG).
Rawformat.guid = = I.formatid)//Picture format consistent//if (I.mimetype = = "Image/png")//default fetch PNG encoder {
ICI = i;
Break
} return ICI; }