Quote:
Originally Posted by AlanHK
But it seem not a lot of SVG coders here.
|
I've fooled around with some SVG transforms before. The short answer to your question is Yes, you can rotate images using just SVG. You can also scale, skew, translate and possibly reflect the image to somewhere else in the viewport. The image could be a jpg, png, geometric primitive such as rect, text, most anything. Look up a reputable tutorial on SVG, especially transforms, and see what you can come up with.
A couple things you must not forget: 1) The viewport defines a virtual "canvas" with left-hand coordinates (meaning simply that the origin is in the UPPER left corner, instead of the BOTTOM left corner), which often corresponds to pixels, but it doesn't have to. All transforms are performed on this canvas. Actual screen pixels aren't assigned until SVG finishes its job. 2) rotations are done about the (0,0) point of the canvas. You will probably want to translate the center of you image to (0,0), do the rotation, and then back-translate it to where it came from.