怎样在一张图片上,获取坐标,动态加载标识(例如一个圈上写上数字),不希望用插件来实现请各位大侠帮忙。。在线等。。分不够再加。
解决方案 »
- 有没有好的js qq帮助 浮动脚本
- 请指点下关于如何写网上书店需求分析的方法
- 求真正的高手:ora 12528:TNS:监听程序:所有适用例程都无法建立新连接(急)
- 给50分!!!!!!解决网页显示不了图片,也就是图片在管理员界面能显示,而在用户界面不能显示,急急,哪位高手能解决,我把前台源代码发上来
- C#操作oracle中的long数据
- 很难的问题,在网页中怎么样得到点击的鼠标坐标.
- 300分求一个:手机购物网站源代码,十分感谢。
- 急,关于aspnet用户
- 新建web工程提示http://1.1 500 internal server error ie 中浏览原来的页面出现乱码
- 怎么我用一个DropDownList的值作为查询条件,老是查出第一个Item的记录啊?
- @import能引用用户自定义命名空间么?
- 透明动画会遮住文本框,咋办?
System.Web.HttpPostedFile MyFile = MyFileCollection[0];
MakeSmallImg(MyFile,filename);
---------------------------------------------------
public void MakeSmallImg(System.Web.HttpPostedFile postFile,string saveImg )
{
///文字水印
//从文件取得图片对象
System.Drawing.Image image = System.Drawing.Image.FromStream(postFile.InputStream,true);
//取得图片大小
System.Drawing.Size size = new Size(image.Height,image.Width);
System.Drawing.Image bitmap = new System.Drawing.Bitmap(size.Width,size.Height);
//获得原图片的长与宽size.Width,size.Height
System.Drawing.Graphics G=System.Drawing.Graphics.FromImage(bitmap);
System.Drawing.Font fonts=new Font("楷体_GB2312",22);
System.Drawing.Brush b=new SolidBrush(Color.Red);
float x=5;
float y=5;
G.DrawString("文字水印",fonts,b,x,y);
G.Dispose();
//保存高清晰度的缩略图
bitmap.Save(strGoodFile, System.Drawing.Imaging.ImageFormat.Jpeg);
image.Dispose();
bitmap.Dispose();
}
Bitmat b= new bitmap(1,1);
int width,height;
//Creat a font object
font afont= new Font("Times New Roman",24,System.Dwawing.GraphicsUnit.Point);
//create a graphics class to measure the text width
Graphics Graphics =Graphics.FromImage(b)//Resize the bitmap
width=(int)graphics.Measurestring(s,aFont).width;
height =(int)graphics.MeasureString(s,aFont).Height;
b=New Bitmap(b,new Size(width,height));
graphics= Graphics.FromImage(b);
graphics.Clear(Color.Black);
graphics.TextRenderingHint = TextrenderingHint.AntiAlias;
graphics.DrawString(s,Afont, hew SolidBrush(Color.Yellow),0,0);
graphics.Flush();
returnt(b);
}
我这段代码是输入一串字符串转换成图形的.希望对你有帮助!