Zoom in to reduce vml_vml correlation

Source: Internet
Author: User
Because VML is vector, zooming in and out becomes easy. Let's look at an example to see how VML can do it. Or a UFO in front as an example. It is a figure pieced together with shapes such as lines, circles, arcs, and so on. I added a move event, and when zoomed in too much, you can drag the picture to view it.

Zoom in 1 time times
Zoom in twice times
Zoom in 3 times times
Zoom in 4 times times
Zoom in 5 times times
Zoom in 6 times times
Zoom in 7 times times
Zoom in 8 times times
Zoom in 9 times times
Zoom in 10 times times


Do you feel it, zooming in and out does not change the quality of VML? Because the VML is vector. Change its coordsize value dynamically, and notice that the decrease is equal to the magnification, and the increase value is equal to the reduction. 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. Call this function using zoom (n) where n is the multiple to enlarge.
When a VML contains text, the graphic zooms in, but the text does not automatically zoom in. This is very asymmetric, there is a technique, that is, the text is wrapped with a marker, 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") will return all the DIV elements on the page and then make their text size larger. It has been proved that the proportion of magnification and VML is invariable.
  • 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.