Shape objects are related to the VML coordinate system_VML

WBOY
Release: 2016-05-16 12:09:46
Original
1436 people have browsed it

Shape is the most basic object of VML. You can use it to draw all the graphics you want. In VML, the coordinates used are not the coordinates of the Document. It has its own coordinate system. In this way, by dynamically changing its coordinates, functions such as zooming in, zooming out, and rotating can be achieved. The CoordSize attribute of shape is used to define coordinates. It has two parameters, . The 2800 and 2800 here are the horizontal and vertical coordinates divided into 2800 points, which are not the default pixels in HTML. If no point is set, VML defaults to 0,0 (upper left corner). Of course, you can also use the CoordOrig property to set the VML point coordinates.

CoordOrig="-1400,-1400" CoordSize="2800,2800" style="width:500;height:500" />

  Note: The coordinates defined by are only relative. The actual displayed graphic size also needs to be defined with style="width:500;height:500"!

After the above definition, the coordinates available to you are x(-1400 to 1400) y(-1400 to 1400). Such coordinates are like coordinates in mathematics, dividing the drawing board into four blocks .



When solving actual problems, I found that IE will automatically Putting the visible VML image at the relative (0,0) position means that if the above two pictures do not add two auxiliary coordinates, they will be displayed as two squares side by side on IE.
The most important attribute in shape is Path, which is a powerful brush. The syntax is very simple and consists of a few letters. It is described in detail below:
m x, y: MoveTo moves the brush to (x, y);
l x,y: LineTo draws a line from the current point to (x, y); you can give several consecutive points, and VML will draw them continuously until they meet x command.
x:Close to end a line;
e:End to end the drawing
Other common attributes of shape:
FillColor: fill color, use the color specified in HTML; for example: fillcolor=red
Filled: whether to fill the graphic, if the graphic is not closed, the graphic will be automatically closed for filling . When Filled="true" (default), fillcolor has an effect;
StrokeColor: the color of the line;
StrokeWeight: the width of the line;
Title: When the mouse moves over the graphic, the text displayed is the same as alt and tilt in HTML;
Type: Specifies which ShapeType the graphic belongs to, and the ShapeType can be The VML formulation template will be described later;
For these previous attributes, FillColor and Filled can be used in , and StrokeColor and StrokeWeight can be used in . It can also be used in Shape or objects that inherit from Shape.
In the following sections, some specific objects extended by Shape will be introduced in detail, such as Rect, RoundRect, Oval, Line and other objects.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template