积极答复者
用摄像头拍下来的照片右下角添加时间

问题
答案
-
hello
把照片存下来后,然后在利用 Graphics 处理
http://stackoverflow.com/questions/2070365/how-to-generate-an-image-from-text-on-fly-at-runtime
http://stackoverflow.com/questions/6826921/write-text-on-an-image-in-c-sharp
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 Jason Dot WangModerator 2013年9月13日 1:23
-
示例代码:
Bitmap bmp = new Bitmap("image file path"); Graphics g = Graphics.FromImage(bmp); String str = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); Font font = new Font("宋体", 8); SolidBrush sbrush = new SolidBrush(Color.Black); g.DrawString(str, font, sbrush, new PointF(10, 10)); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
或者参考这个:
http://www.jb51.net/article/31994.htmCaillen
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 Jason Dot WangModerator 2013年9月13日 1:23
全部回复
-
已经是图片了,可以任意操作,网上搜索加水印的代码
-
hello
把照片存下来后,然后在利用 Graphics 处理
http://stackoverflow.com/questions/2070365/how-to-generate-an-image-from-text-on-fly-at-runtime
http://stackoverflow.com/questions/6826921/write-text-on-an-image-in-c-sharp
秘訣無它,唯勤而已 http://www.dotblogs.com.tw/yc421206/
- 已标记为答案 Jason Dot WangModerator 2013年9月13日 1:23
-
示例代码:
Bitmap bmp = new Bitmap("image file path"); Graphics g = Graphics.FromImage(bmp); String str = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); Font font = new Font("宋体", 8); SolidBrush sbrush = new SolidBrush(Color.Black); g.DrawString(str, font, sbrush, new PointF(10, 10)); MemoryStream ms = new MemoryStream(); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
或者参考这个:
http://www.jb51.net/article/31994.htmCaillen
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 Jason Dot WangModerator 2013年9月13日 1:23