找回密码
 立即注册
搜索
查看: 1658|回复: 3

如何在IE浏览器中绘图?

[复制链接]

105

主题

1729

回帖

2454

积分

论坛元老

积分
2454
发表于 2004-8-11 13:58:11 | 显示全部楼层 |阅读模式
请问如何在IE浏览器中实现实时绘图功能?是不是需要做组件啊?

1678

主题

5167

回帖

9302

积分

荣誉版主

沉痛悼念小于……

积分
9302
发表于 2004-8-12 14:08:53 | 显示全部楼层
不必,使用VML可以实现

比如:

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">

<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>zhy</o:Author>
<o:Template>Normal</o:Template>
<o:Revision>1</o:Revision>
<o:TotalTime>1</o:TotalTime>
<o:Created>2003-05-10T09:20:00Z</o:Created>
<o:Pages>1</o:Pages>
<o:Characters>1</o:Characters>
<o:Company>yd</o:Company>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>1</o:CharactersWithSpaces>
<o:Version>9.2812</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:PunctuationKerning/>
<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
<w:Compatibility>
<w:SpaceForUL/>
<w:BalanceSingleByteDoubleByteWidth/>
<w:DoNotLeaveBackslashAlone/>
<w:ULTrailSpace/>
<w:DoNotExpandShiftReturn/>
<w:AdjustLineHeightInTable/>
<w:UseFELayout/>
</w:Compatibility>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
    {font-family:宋体;
    panose-1:2 1 6 0 3 1 1 1 1 1;
    mso-font-alt:SimSun;
    mso-font-charset:134;
    mso-generic-font-family:auto;
    mso-font-pitch:variable;
    mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
    {font-family:"\@宋体";
    panose-1:2 1 6 0 3 1 1 1 1 1;
    mso-font-charset:134;
    mso-generic-font-family:auto;
    mso-font-pitch:variable;
    mso-font-signature:1 135135232 16 0 262144 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0cm;
    margin-bottom:.0001pt;
    text-align:justify;
    text-justify:inter-ideograph;
    mso-pagination:none;
    font-size:10.5pt;
    mso-bidi-font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:宋体;
    mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
    {mso-page-border-surround-header:no;
    mso-page-border-surround-footer:no;}
@page Section1
    {size:595.3pt 841.9pt;
    margin:72.0pt 90.0pt 72.0pt 90.0pt;
    mso-header-margin:42.55pt;
    mso-footer-margin:49.6pt;
    mso-paper-source:0;
    layout-grid:15.6pt;}
div.Section1
    {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1"/>
</o:shapelayout></xml><![endif]-->
</head>

<body lang=ZH-CN style='tab-interval:21.0pt;text-justify-trim:punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

<p class=MsoNormal><!--[if gte vml 1]><v:shapetype id="_x0000_t176"
coordsize="21600,21600" o:spt="176" adj="2700" path="m@0,0qx0@0l0@2qy@0,21600l@1,21600qx21600@2l21600@0qy@1,0xe">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="val #0"/>
<v:f eqn="sum width 0 #0"/>
<v:f eqn="sum height 0 #0"/>
<v:f eqn="prod @0 2929 10000"/>
<v:f eqn="sum width 0 @3"/>
<v:f eqn="sum height 0 @3"/>
<v:f eqn="val width"/>
<v:f eqn="val height"/>
<v:f eqn="prod width 1 2"/>
<v:f eqn="prod height 1 2"/>
</v:formulas>
<v:path gradientshapeok="t" limo="10800,10800" o:connecttype="custom"
o:connectlocs="@8,0;0,@9;@8,@7;@6,@9" textboxrect="@3,@3,@4,@5"/>
</v:shapetype><v:shape id="_x0000_s1028" type="#_x0000_t176" style='position:absolute;
left:0;text-align:left;margin-left:135pt;margin-top:31.2pt;width:171pt;
height:101.4pt;z-index:1'>
<v:textbox>
<![if !mso]>
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td><![endif]>
<div>
<p class=MsoNormal><span style='font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"'>不用图片的圆角表格???</span></p>
</div>
<![if !mso]></td>
</tr>
</table>
<![endif]></v:textbox>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout'>

<table cellpadding=0 cellspacing=0 align=left>
<tr>
<td width=180 height=42></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</span><![endif]><span lang=EN-US><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span>
</div>
</body>
</html>
回复

使用道具 举报

1678

主题

5167

回帖

9302

积分

荣誉版主

沉痛悼念小于……

积分
9302
发表于 2004-8-12 14:10:37 | 显示全部楼层
也可以使用.NET实现更加复杂的图形

动态的生成一个图片显示当前时间.
namespace Wmj
{
using System;
using System.Drawing;
using System.Web.UI;



public class MyTempImage : Page
{
    public string CreateImage()
    {
       string str=DateTime.Now.ToString();
       Bitmap image=new Bitmap(200,30);
       Graphics g=Graphics.FromImage(image);
       string thefullname=Server.MapPath("/")+"\\nowtime.gif";
       g.Clear(Color.White);
g.DrawString(str,new Font("Courier New", 10),new SolidBrush(Color.Red),20,5);
//Graphics 类还有很多绘图方法可以绘制 直线、曲线、圆等等
       image.Save(thefullname,System.Drawing.Imaging.ImageFormat.Gif);
       return "/nowtime.gif";
    }
}
}




///////////////////////////////////////////
<%@page language="C#"%>
<%@Import namespace="Wmj"%>
<script language="C#" runat="server">
void Page_Load(object sender,EventArgs e)
{
    MyTempImage myTempImage=new MyTempImage();
    img1.Src=myTempImage.CreateImage();
}
</script>
<html>
<head>
<!--每10秒自动刷新-->
<meta http-equiv="refresh" content="10">
</head>
<body>
<form runat="server">
<input type="button" value="手动刷新" onclick="location.reload()">
<img id="img1"  runat="server"/>
</form>
</body>
</html>
回复

使用道具 举报

105

主题

1729

回帖

2454

积分

论坛元老

积分
2454
 楼主| 发表于 2004-8-14 14:53:56 | 显示全部楼层
用ASP可以吗?不用ASP.net?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|海浩社区

GMT+8, 2025-9-20 18:05 , Processed in 0.082526 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表