Geometry
Purpose : Alternative high memory requirements in some scenarios, using the drawing the way geometry <Image>
to reduce memory
Rectangle (rectangle, rounded rectangle)
<Rectangle x = "10" y = "20" w = "100" h = "200" cornerRadius = "5,10" strokeColor = "# ff00ff00" fillColor = "# ff000000" weight = "5" cap = "round "dash =" 1,2,3,4 "strokeAlign =" center "xfermode =" "xfermodeNum =" ">
<StrokeShaders>
<LinearGradient x = "" y = "" x1 = "" y1 = "" tile = "">
<GradientStop color = "" position = "" />
......
<GradientStop color = "" position = "" />
</ LinearGradient>
<RadialGradient x = "" y = "" rX = "" rY = "" tile = "">
<GradientStop color = "" position = "" />
......
<GradientStop color = "" position = "" />
</ RadialGradient>
<SweepGradient x = "" y = "" rotation = "" tile = "">
<GradientStop color = "" position = "" />
......
<GradientStop color = "" position = "" />
</ SweepGradient>
<BitmapShader src = "" tile = "," />
</ StrokeShaders>
<FillShaders>
</ FillShaders>
</ Rectangle>
- Properties
x
,y
: top-left corner pointcornerRadius
: fillet radius, the format "x radial, y radial"strokeColor
: stroke color. Text of the same color and support a variety of color specified ways, such as no special instructions, all of the following color properties of the class are true.fillColor
: Fill Colorweight
: stroke widthcap
: thread shape. Wireless butt head (default), round (semi), squre (square)dash
: dotted line pattern. Format "line length, spacing, line length, interval ....", eg dash = "1,2,3,4": 1 pixel wide line, 2 pixels spacing, line 3 pixels, 4 pixels interval , repeat ...strokeAlign
: stroke alignment, described within the inner, center stroke center, outer outer scanning (default)xfermode
,xfermodeNum
: mixed mode, and<Image />
same
StrokeShaders
stroke
shader: Supports linear gradient color, radial gradient coloring (radial gradient), scanning the gradient coloring (circumferential gradient), bitmap coloring.
<LinearGradient>
linear gradient:x
,y
,x1
,y1
: gradient axis (x, y) -> (x1, y1)tile
(spread mode): clamp stretching (default), mirror image, repeat repeat
<RadialGradient>
radial gradient:x
,y
: center positionrX
,rY
: x, y radial direction
<SweepGradient>
Scanning gradation:x
,y
: center positionrotation
: rotation angle
<BitmapShader>
Bitmap Coloring:src
: Image Sourcetile
: Format "x direction mode, y direction mode"
GradientStop
gradient point:several
gradient between the specified color to do gradientcolor
: color gradient pointsposition
: Gradient position, 0 to 1.0 Float
- FillShaders
shaderFill
: with StrokeShaders grammar identical.
Ellipse (oval)
<Ellipse x = "10" y = "20" w = "100" h = "200" strokeColor = "# ff00ff00" fillColor = "# ff000000" weight = "5" cap = "round" dash = "1,2 , 3,4 "strokeAlign =" center "xfermode =" "xfermodeNum =" ">
<StrokeShaders>
</ StrokeShaders>
<FillShaders>
</ FillShaders>
</ Ellipse>
x
,y
: position of the center of the ellipsew
,h
: ellipse width, height
Circle (round)
<Circle x = "10" y = "20" r = "50" strokeColor = "# ff00ff00" fillColor = "# ff000000" weight = "5" cap = "round" dash = "1,2,3,4" strokeAlign = "center" xfermode = "" xfermodeNum = "">
<StrokeShaders>
</ StrokeShaders>
<FillShaders>
</ FillShaders>
</ Circle>
x
,y
: center positionr
: Radius
Arc (segment, arc)
<Arc x = "10" y = "20" w = "100" h = "200" startAngle = "10" sweep = "50" close = "true" strokeColor = "# ff00ff00" fillColor = "# ff000000" weight = "5" cap = "round" dash = "1,2,3,4" strokeAlign = "center" xfermode = "" xfermodeNum = "">
<StrokeShaders>
</ StrokeShaders>
<FillShaders>
</ FillShaders>
</ Arc>
x
,y
,w
,h
: positioning the same way as EllipsestartAngle
: Starting anglesweep
: scanning angle (angle sector)close
: is closed, true closure is fan-shaped, false is not closed arc
Line (straight line)
<Line x = "10" y = "20" x1 = "100" y1 = "200" strokeColor = "# ff00ff00" weight = "5" cap = "round" dash = "1,2,3,4" strokeAlign = "center" xfermode = "" xfermodeNum = "">
<StrokeShaders>
</ StrokeShaders>
</ Line>
x
,y
,x1
,y1
: linear starting point (x, y), end point (x1, y1)- Precautions:
- Alignment
align
,alignV
: Rectangle support only, others are not supported, they arex
,y
are referred to the center point, does not require alignment. Filling
: line class graphics ignoredfillColor
and<FillShaders>
; has an area of graphics support stroke and fill, respectively, for stroke and fill.Priority
: WhenstrokeColor
and<StrokeShaders>
exist, priority use<StrokeShaders>
; fillColor andversa. strokeColor
: If you want the stroke occurs, thestrokeColor
and<StrokeShaders>
must be at least a presence; do not exist will not have a stroke.Gradient
Location:<LinearGradient x = "" y = ""> ...
in thex
,y
is relative it in the graphic elements positioned.
- Alignment