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.