如何在ASP.NET中写入图像 [英] How to write on image in ASP.NET

查看:43
本文介绍了如何在ASP.NET中写入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在发送邮件时写在图像上。我是用户ckeditor,但是在ckeditor中

i可以插入图片但不能在图像上写任何文字。



任何人都可以帮我解决我的问题。如果可能,它是否有可能是怎么回事。



我尝试了什么:



我为我的上传图片和文字尝试了ckeditor。

I want to write on image when sending mail.I user ckeditor for this but in ckeditor
i can insert image but not write any text on image.

any one help me for my problem.is it possible or not if possible how is it.

What I have tried:

I tried ckeditor for my upload image and text.

推荐答案

如果你有服务器上的图像 - 如果它可以从C#代码访问 - 那么它很简单:

If you have the image on your server - and if it's accessible from C# code it is - then it's simple:
using (Image im = Bitmap.FromFile(Path.Combine(imagesPath, "MyPic.jpg")))
    {
    using (Graphics g = Graphics.FromImage(im))
        {
        g.DrawString("HELLO!", myFont, myBrush, xLocation, yLocation);
        im.Save(Path.Combine(imagesPath, "MyPicWrittenOn.jpg", ImageFormat.Jpeg));
        }
    }


这篇关于如何在ASP.NET中写入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆