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.