Zoom in and out VML_VML Problems

Source: Internet
Author: User
To zoom in and out VML, because VML is vector, it is easy to zoom in and out. Let's take a look at an example to see how much VML can do. The previous UFO is used as an example. It is a combination of line, circle, arc and other shapes. I have added a mobile event. If you zoom in too much, you can drag the picture to view it.

Doubled
2 times
Zoom in 3 times
Up to 4 times
5 times
6 times larger
Zoom in 7 times
8 times
9 times larger
Zoom in 10 times


Are you sure you want to zoom in or out the VML image quality? Because VML is vector. You can change its coordsize value dynamically. Note that the reduced value is equal to the enlarged value, and the increased value is equal to the reduced value. You can refer to the following script:

Var xx= 6000;
Var yy = 6000;
Function zoom (h)
{
Group1.coordsize = xx/h + "," + yy/h;
}

In the preceding xx, yy refers to the coordsize value in the default state. Use zoom (n) when calling this function, where n is a multiple to be enlarged.
When VML contains text, the image is zoomed in, but the text is not automatically zoomed in. In this way, it is very asymmetrical. There is a trick: text is wrapped with a mark, and 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"). item (I). style. fontSize = fs * h + "pt ";
}

Fs is the text size in the default state. Document. all. tags ("DIV") returns all the DIV elements on the page, and increases the text size. Practice has proved that the proportion to VML after amplification remains 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.