Zoom in and zoom out VML_VML related

Source: Internet
Author: User
Since VML is a vector, zooming in and out becomes very easy. Let's look at an example to see how far VML can go. Or a UFO in front as an example. It is a graph which is pieced together with lines, circles, arcs and so on. I added mobile events, and when magnified too much, you can drag pictures to view them.

--> arrowok= "T" >
Magnified 1 time Times
Magnified twice times
Magnified 3 times times
Magnified 4 times times
Magnified 5 times times
Magnified 6 times times
Magnified 7 times times
Magnified 8 times times
Magnified 9 times times
Magnified 10 times times


Do you feel it, zoom in and zoom out on the VML quality unchanged? Because VML is a vector. Dynamically changing its coordsize value, note that the reduced value equals magnification, and the increment is equal to narrowing. You can refer to the following script:

var xx=6000;
var yy=6000;
function Zoom (h)
{
group1.coordsize= xx/h+ "," +yy/h;
}

The xx,yy above refers to the Coordsize value in the default state. When calling this function, use zoom (n) where n is the multiplier to enlarge.
When VML contains text, the graphics zoom in, but the text does not automatically enlarge. This is very asymmetric, there is a technique, that is, the text is wrapped in a tag, the amplification function needs to be improved:
var xx=6000;
var yy=6000;
var fs=9;
function Zoom (h)
{
group1.coordsize= xx/h+ "," +yy/h;
For (Var i=0;i<document.all.tags ("DIV"). length;i++)
Document.all.tags ("DIV"). Item (i). style.fontsize= fs*h+ "PT";
}

FS is the text size in default state. Document.all.tags ("div") returns all the DIV elements on the page, and then the size of their text becomes larger. Practice has proved that the proportion of the enlarged and VML is unchanged.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.