(C #) Remove the picture from the clipboard, then write the word, save to file [turn]

xiaoxiao2021-03-06  65

The following code implements the picture from the clipboard, then writes the word, save it to the file image bmap; idataObject data = system.Windows.Forms.clipboard.GetDataObject (); bmap = (image) (data.getdata (typeof .Drawing.Bitmap))); Graphics g = Graphics.FromImage (bmap); SolidBrush drawBrush = new SolidBrush (Color.Red); Font drawFont = new Font ( "Arial", 10, FontStyle.Bold, GraphicsUnit.Millimeter); INT XPOS = BMap.Height - (BMap.Height-25); int ypos = 3; g.drawstring ("ZydzyDydydyydydydy", DrawFont, Drawbrush, XPOS, YPOS; String SpicPath = "D: //filename.jpg"; string sPreFix = "d: // xxx"; Image smBmap; smBmap = bmap.GetThumbnailImage (bmap.Width, bmap.Height, null, System.IntPtr.Zero); smBmap.Save (sPicPath, System.Drawing.Imaging.ImageFormat .Jpeg); BMap.save (SPREFIX ".jpg", System.drawing.Imaging.ImageFormat.jpeg); BMAP = NULL; SMBMAP = NULL;

Author Blog:

http://blog.9cbs.net/dahuzizyd/

转载请注明原文地址:https://www.9cbs.com/read-119285.html

New Post(0)