[html5] Exporting a large Canvas to SVG

CYp tccyp86 at hotmail.com
Mon Mar 8 12:47:28 PST 2010


I think you can use the method: void drawImage(in HTMLCanvasElement image, in float dx, in float dy, in optional float dw, in float dh);
using this method you can draw one canvas to another one with scale.

Date: Mon, 8 Mar 2010 15:02:32 -0500
From: shaunwithanau at gmail.com
To: help at lists.whatwg.org
Subject: [html5] Exporting a large Canvas to SVG

Currently I am drawing a very large picture to the canvas (think an entire building measured in inches) which is composed of numerous lines (approx 20000). Obviously this picture is having to be scaled down considerably to fit on a canvas. However the user has the option to zoom in on this picture. What this in turn does is set a scaling factor to the canvas causing parts of the drawing to be outside of the canvas's dimensions. 

What I want to do is use SVG (which can be much larger but cannot be used to draw the picture as it consists of too many lines) to replicate what is being drawn to the canvas (including the parts that spill over). This is because I can place the large SVG inside of a limited sized <div> and the user will be able to use the scroll bars to see the entire building. 

The idea is that I let canvas handle the data and scaling. Then once I have it the size that I want,  then display it in SVG.
My question is will this work with toDataURL? I am guessing that it wont, as it will just send what is actually visible on the canvas to the SVG. 


Is there any other way to do this or something similar?



 		 	   		  
_________________________________________________________________
一张照片的自白――Windows Live照片的可爱视频介绍
http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20100309/bfd982c7/attachment-0003.htm>


More information about the Help mailing list