如何在网页上画图(如画圆)?

blademan 2000-11-26 11:51:00
用vbs,Javascript均可。
...全文
332 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
blademan 2000-11-26
  • 打赏
  • 举报
回复
我已经自己编了个ocx解决了,不过还是很感谢你!
zhangzhonghua 2000-11-26
  • 打赏
  • 举报
回复
救人一命,胜造7级浮屠。
这个技术叫做 DirectAnimation multimedia controls.
MSDN路径为:PlatformSDK | Web Services | Workshop | Streaming & Interactive Media
看例子,放到IIS或PWS的wwwroot下,通过http带开URL看看。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<!-- Copyright 1998 Microsoft Corporation. All rights reserved. -->

<TITLE>Microsoft DirectAnimation Multimedia Controls Sample - Structured Graphics utilizing DrawingSurface</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META NAME="AUTHOR" CONTENT="InetSDK">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="ROBOTS" CONTENT="noindex">

<!-- SAMPLE_STYLE_START -->
<LINK REL="stylesheet" HREF="../../../../../../workshop/basicsdkie4.css" TYPE="text/css">
<!-- SAMPLE_STYLE_END -->
</HEAD>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#000000" TEXT=RED LINK="#000000" VLINK="#808080" ALINK="#000000">
<BLOCKQUOTE CLASS="body">

<DIV STYLE="font-size: 12 pt; font-family: Verdana, Arial, Helvetica">
<H3>Structured Graphics Sample Utilizing DrawingSurface</H3>
</DIV>
<HR>

<OBJECT ID="SG1"
STYLE="Position:absolute; WIDTH:425; HEIGHT:425; top:10; left;10;Z-INDEX: -1"
CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>

<SCRIPT LANGUAGE="VBScript">
<!--
dim ds

Set lib = SG1.Library ' This sets up the DirectAnimation Library for
' DrawingSurface operations.
Set ds = SG1.DrawSurface ' This sets up a container named "ds" as SG1's ' DrawingSurface property container; you use this
' container to construct your shape with DrawingSurface
call ds.fillcolor(lib.blue) ' This sets the color for the square

call ds.rect(-50,-50,200,200) ' This draws the square
call ds.fillcolor(lib.ColorRgb255(200,200,255)) ' This sets the color for the Oval using RGB255 values
call ds.oval(-60,-60, 120, 120) ' This draws the oval

ds.SaveGraphicsState() ' This sets up a subsection marker inside of the shape
' you are constructing; it tells the DrawingSurface that
' you want to perform an operation on the following shape
' independently of the rest of the shape already constructed.

call ds.transform(lib.rotate2rate(5)) ' This invokes a 2 dimensional rotation (z-axis rotation)
' of the shape you're about to construct in the following
' script calls
call ds.fillcolor(lib.ColorRgb255(255,0,0))
call ds.rect(-20, -100, 40,200) ' This draws the rectangle to be rotated
ds.RestoreGraphicsState() ' This closes the subsection opened by pushgraphicstate
' operations.

SG1.DrawSurface = ds ' This returns the shape you have constructed to SG1
' for painting to the screen

Call RotateMe

Sub RotateMe
call SG1.rotate(2,0,2)
DoTheWork=window.setTimeout("call RotateMe",50,"vbscript") ' This does a 10-degree x-axis rotation.

End Sub

-->
</SCRIPT>

<DIV STYLE="position:absolute; top:450">
<!-- START_PAGE_FOOTER -->
<BR><BR><BR>
© <A CLASS="clsIncCpyRt" HREF="http://msdn.microsoft.com/isapi/gomscom.asp?target=/misc/cpyright.htm" TARGET="_top">2000 Microsoft Corporation. All rights reserved. Terms of use</A>.
<!-- END_PAGE_FOOTER -->
</DIV>
</BLOCKQUOTE>
</BODY>
</HTML>
blademan 2000-11-26
  • 打赏
  • 举报
回复
竟然没人知道?还是嫌我太笨,懒得理我?
我只是想知道怎么在网页上画圆和画点,不会是不能画吧?
也不知道教计算机图形学的老师是怎么想的,留了个用多边形填充法画圆的作业,还非得在IE中实现,全班没人会做,同学们就逼我想办法,可我只会用VB,VC,Delphi……
请各位大侠救命!

1,451

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计/Flash/Silverlight 开发 图象工具使用
社区管理员
  • 图象工具使用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧