加水印后,在controller里面传到服务器里面保存
这是controller的代码
public ActionResult AddNewsPic(string id)
{
if (Request.Files.Count > 0)
{
if (!string.IsNullOrEmpty(Request.Files[0].FileName))
{
Stream fileDataStream = null;
int filelength = 0;
byte[] byteImgData = null;
fileDataStream = Request.Files[0].InputStream;
filelength = Request.Files[0].ContentLength;
byteImgData = new byte[filelength];//存储二进制
fileDataStream.Read(byteImgData, 0, filelength);
string eid = Request.Form["id"].ToString();
string Summary = Request.Form["Summary"].ToString();
NewsBLL poluBLL = new NewsBLL();
bool temp = poluBLL.AddNewsPic(null, Summary, byteImgData, eid);
}
}
ViewBag.eID = id;
return View();
}
怎么在controller中图片上传之前,对图片加一个文字水印