以文本方式查看主题 - 计算机科学论坛 (http://bbs.xml.org.cn/index.asp) -- 『 SVG/GML/VRML/X3D/XAML 』 (http://bbs.xml.org.cn/list.asp?boardid=21) ---- 很久没来了,今天又遇到一个问题,再次跪求答案!!!! (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=18084) |
-- 作者:moonsky731 -- 发布时间:5/10/2005 3:48:00 PM -- 很久没来了,今天又遇到一个问题,再次跪求答案!!!! 我写了一个动态绘制SVG图形的代码,现在遇到一个问题 <g width="400" height="50" id="ggg"> <rect width="200" height="50" fill="#FF9966" x="100" y="100"/> <rect width="200" height="50" fill="#FF9966" x="200" y="100"/> <rect width="200" height="50" fill="#FF9966" x="300" y="100"/> <rect width="200" height="50" fill="#FF9966" x="400" y="100"/> <text x="150" y="150" font-size="55">a</text> </g> 我现在把这个<g>当成一个整体,在我的眼里它是一个图形,现在我想把这个<g>里的所有图形元素都放大,不是viewBox和scale那种暂时变大,是实际width和height实际变大,我实在不想把<g>里的每个元素一个一个的改属性,最好以<g>作为整体来,请问哪位那位大爷有好方法呀? |
-- 作者:zzzzzz2 -- 发布时间:5/10/2005 11:49:00 PM -- <g> 的属性有哪些,大哥? 一起学习吧,我被<g>元素快弄疯了!~~ |
-- 作者:moonsky731 -- 发布时间:5/11/2005 10:20:00 AM -- 我只能告诉你,<g>得属性有很多 |
-- 作者:suming -- 发布时间:5/13/2005 4:43:00 PM -- 用不用跪求啊?!俺是个新手,俺帮不了你。SORRY。 |
-- 作者:edison1024 -- 发布时间:5/16/2005 10:28:00 AM -- <g alignment-baseline="" baseline-shift="" class="" clip-path="" clip="" clip-rule="" color="" color-interpolation="" color-interpolation-filters="" color-profile="" color-rendering="" cursor="" direction="" display="" dominant-baseline="" enable-background="" externalResourcesRequired="" fill="" fill-opacity="" fill-rule="" filter="" flood-color="" flood-opacity="" font-family="" font-size="" font-size-adjust="" font-stretch="" font-style="" font-variant="" font-weight="" glyph-orientation-horizontal="" glyph-orientation-vertical="" id="" image-rendering="" kerning="" letter-spacing="" lighting-color="" marker-end="" marker-mid="" marker-start="" mask="" onactivate="" onclick="" onfocusin="" onfocusout="" onload="" onmousedown="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" opacity="" overflow="" pointer-events="" requiredExtensions="" requiredFeatures="" shape-rendering="" stop-color="" stop-opacity="" stroke="" stroke-dasharray="" stroke-dashoffset="" stroke-linecap="" stroke-linejoin="" stroke-miterlimit="" stroke-opacity="" stroke-width="" style="" systemLanguage="" text-anchor="" text-decoration="" text-rendering="" transform="" unicode-bidi="" visibility="" word-spacing="" writing-mode="" xml:base="" xml:lang="" xml:space="" > |
-- 作者:mxr -- 发布时间:10/3/2005 4:44:00 PM -- <?xml version="1.0"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> <svg width="800" height="900"> <script><![CDATA[ function createcircle(cx,cy,r,n,a,b,c){ parentgroup=svgDocument.getElementById("canv"); var newnode=svgDocument.createElement("circle"); newnode.setAttribute("cx",cx); newnode.setAttribute("cy",cy); newnode.setAttribute("r",r); newnode.setAttribute("fill-opacity",n); newnode.setAttribute("fill","rgb(" + a + "," + b + "," + c + ")"); parentgroup.appendChild(newnode); } ]]> </script> <g id="canv" onclick="createcircle(100,100,50,0.2,0,0,255)"> <rect x="1" y="1" width="798" height="599" style="fill:red;stroke:blue;fill-opacity:0.1"/> </g> </svg> 写函数实现,这是一个函数化的画圆的例子,你可以参考一下! |
-- 作者:yuxi2000 -- 发布时间:10/11/2005 10:48:00 PM -- 使用转换矩阵 |
-- 作者:xmshaonian -- 发布时间:12/14/2005 10:27:00 PM -- 对,好像用matrix可以实现, 不过我自己现在也想知道如何给matrix定参数 |
-- 作者:weiwei530530 -- 发布时间:12/14/2005 10:43:00 PM -- 好笑,难道scale和matrix转换矩阵不是同一回事? 5楼漏了<g>最特殊的属性 enable-backgound |
-- 作者:yooono -- 发布时间:12/25/2005 8:53:00 AM -- 站起来吧 我也不会 |
-- 作者:xmshaonian -- 发布时间:1/11/2006 1:59:00 PM -- 自己笑自己一个,确实没有区别, 不过 enable-backgound 属性是做什么用的呢? |
-- 作者:xmshaonian -- 发布时间:1/11/2006 2:09:00 PM -- 自己笑自己一个,确实是一样地,没有区别 问一下,enable-backgound属性有什么用呢、 |
-- 作者:jerryshou -- 发布时间:1/11/2006 6:01:00 PM -- 高手们有必要站出来指教一下 |
-- 作者:super_xixi -- 发布时间:1/13/2006 6:28:00 PM -- 我说一个我自己的想法啊,你们别笑啊,虽然我对SVG不熟悉,但是,我想,能不能构建一个自己的解析XML文档的函数,将<g>元素里面的属性自动放大到你想要的程度? |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
7,734.375ms |