如何使用我的公司签名在数据库中上载图像 [英] How Do I Upload Images In Database With My Company Signature
问题描述
http://dhupguri.quikr.com/gt-I8262-Samsung-galaxy-core -W0QQAdIdZ223088082 [ ^ ]
请通过链接...在那里你可以找到手机的图像,在图像公司名称写成www.quikr.com。如何在用户上传图片时这样做。
i我正在使用sql server和c#.net web application.my网站是 http://ebsindiaonline.com/Free-ads [ ^ ]
i希望在图像中使用我的公司签名上传图像。如何做到这一点?
请帮帮我。
thnx提前。
< blockquote>解决方案提供如下:
http:/ /lmgtfy.com/?q=c%23+add+image+watermark [ ^ ]
DataTable dt = new DataTable();
dt.Columns.Add( col1,typeof(byte []));
Image img = Image.FromFile(@文件的物理路径);
DataRow dr = dt.NewRow ();
dr [col1] = imageToByteArray(img);
dt.Rows.Add(dr);
-----------------------------
public byte [] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save (ms,System.Drawing.Imaging.ImageFormat.Gif);
返回ms.ToArray();
}
---- -------------------------------
映射此数据表到数据库表。
http://dhupguri.quikr.com/gt-I8262-Samsung-galaxy-core-W0QQAdIdZ223088082[^]
please go through the link...there you can find images of a mobile and in the images company name is written "www.quikr.com".how to do that when a user upload images.
i am using sql server and c#.net web application.my website is http://ebsindiaonline.com/Free-ads[^]
i want to upload images in database with my company signature in the images.how to do that?
please help me out.
thnx in advance.
The solution is provided below:
http://lmgtfy.com/?q=c%23+add+image+watermark[^]
DataTable dt = new DataTable();
dt.Columns.Add("col1", typeof(byte[]));
Image img = Image.FromFile(@"physical path to the file");
DataRow dr = dt.NewRow();
dr["col1"] = imageToByteArray(img);
dt.Rows.Add(dr);
-----------------------------
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
-----------------------------------
Map this datatable to database table.
这篇关于如何使用我的公司签名在数据库中上载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!