Hi Peter,

> On Mar 4, 2006, at 8:29 AM, [EMAIL PROTECTED] wrote:
> 
> >> How about this for an alternative:
> >>
> >> 1.  Convert all the SVG's to PNG files
> >> 2.  Add them to a document as <image> elements
> >
> >    This is certainly a viable alternative.

Peter Wagener <[EMAIL PROTECTED]> wrote on 03/05/2006 12:37:24 
AM:

> I'm having trouble getting the initial embedded PNG to size itself 
> correctly when setting the original document on the JSVGCanvas.  The 
> image is larger than the initial size of the canvas, but it doesn't 
> scale down correctly.  Instead, I only see the upper-left corner of it.

> Interestingly enough, if I first set an SVG file as the document (I 
> created a blank SVG file in Illustrator), then append PNG's to that, 
> they are sized correctly.  Apparently I'm not creating my initial 
> document correctly ... ?

   The problem is that you aren't providing width/height/viewBox on
the outermost SVG element.  I'm guessing your initial document 
from Illustrator had those in it already.

   Just a comment, it would be much better to have the build up
SVG file reference the PNG file as a separate file rather than
encoding the File as Base64 and embedding.

> Also, I've noticed I'm not able to attach event listeners to image 
> elements in the same way I was with SVG elements.  Is there a 
> difference in how those should be treated?

   No.  Event listeners should work just the same on an image element
as on anything else.  Did you perhaps break having the document be
dynamic in the Canvas?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to