A…………g…………a…………i…………n
解决方案 »
- 如何取得ajax返回值中的responseText?
- 关于JavaScript的onsubmit事件,请大家帮忙!
- 使用原生的JS没用框架读写Cookies有没有浏览器差异?
- 大家有用IE8的吗?在IE8下用JS装入的内容好像都会出界,这是为什么啊
- 动态添加表格!表格数据如何提交服务器?
- 鼠标右键问题
- ~~~~~~~~~~~~~~~~动态添加thead问题,马上给分!~~~~~~~~~~~~~~~~~~~
- JavaScript使用OFFICE图表组件做统计的小程序,运行老是不行,不知是哪儿语法出错,DX请出手。
- 前端求助!下拉框根据取值变更颜色!
- 为什么 1 in [1] 为false ,我该怎么写
- 一个表单两个submit按钮
- 求助!!!怎么关闭本网站同一IE进程打开的所有窗口!
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style>
v\:*{Behavior:url(#default#VML)}
</style>
<script language="javascript">
window.onload = function(){
document.getElementById("line01").innerHTML = drowLine("100,200 150,50 200,330 250 79 500,240");
}
function drowLine(linePoints){
var str = "<v:PolyLine filled='false' style='z-index:1' strokeColor='#0066CC' strokeWeight='2px' ";
str += "Points='"+linePoints+"' />";
return str;
}
</script>
</head>
<body>
<v:group ID="group1" style="position:relative;WIDTH:800px;HEIGHT:400px;" coordsize = "800,400">
<div id="line01"></div>
</v:group>
</body>
</html>
还有,在上面画线该怎么搞啊?netWild说的用VML在网页上画线我还是不是很懂,有什么资料可以参考吗?
生成文字也很简单的,查询API后,调试不久就会有收获,以下是生成文字用。C# code string sFontColor = dd_fontcolor.SelectedItem.Text;
string sFontFamily = dd_fontsize.SelectedItem.Text;
string sBgColor = dd_bgcolor.SelectedItem.Text;
string sText = tb_text.Text;
string sFontSize = dd_fontsize.SelectedItem.Text;
#region 生成图片代码
Bitmap bmp = null; Graphics grc = null;
try
{
// 首先填充一个1*1像素的图,计算高度和宽度
int nFontSize = 10;
try
{
nFontSize = Int32.Parse(sFontSize);
}catch{}
Font font = new Font(sFontFamily, nFontSize);
bmp = new Bitmap(1,1, PixelFormat.Format32bppArgb);
grc = Graphics.FromImage(bmp);
SizeF szf = grc.MeasureString(sText, font);
Color clr_bg = ColorTranslator.FromHtml(sBgColor);
Color clr_tx = ColorTranslator.FromHtml(sFontColor); int width = (int)szf.Width;
int height = (int)szf.Height;
// 释放资源
grc.Dispose(); bmp.Dispose(); bmp = new Bitmap(width, height, PixelFormat.Format32bppArgb);
grc = Graphics.FromImage(bmp);
grc.FillRectangle(new SolidBrush(clr_bg), new Rectangle(0,0,width,height));
grc.DrawString(sText, font, new SolidBrush(clr_tx), 0, 0);
MemoryStream temp = new MemoryStream();
bmp.Save(temp, ImageFormat.Png);
Response.BinaryWrite(temp.ToArray());
}
catch(Exception ex)
{
Response.Write(ex.ToString());
}
finally
{
if (grc!=null) grc.Dispose();
if (bmp!=null) bmp.Dispose();
}
#endregion
}
}
目前尝试中!