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 point
    • cornerRadius: 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 Color
    • weight: stroke width
    • cap: 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 position
    • rX, rY: x, y radial direction
  • <SweepGradient> Scanning gradation:
    • x, y: center position
    • rotation: rotation angle
  • <BitmapShader> Bitmap Coloring:
    • src: Image Source
    • tile: Format "x direction mode, y direction mode"
  • GradientStop gradient point:
    • several gradient between the specified color to do gradient
    • color: color gradient points
    • position: 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 ellipse
  • w, 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 position
  • r: 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 Ellipse
  • startAngle: Starting angle
  • sweep: 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 are x, y are referred to the center point, does not require alignment.
    • Filling: line class graphics ignored fillColor and <FillShaders>; has an area of ​​graphics support stroke and fill, respectively, for stroke and fill.
    • Priority: When strokeColor and <StrokeShaders> exist, priority use <StrokeShaders>; fillColor and versa.
    • strokeColor: If you want the stroke occurs, the strokeColor and <StrokeShaders> must be at least a presence; do not exist will not have a stroke.
    • Gradient Location: <LinearGradient x = "" y = ""> ...in the x, y is relative it in the graphic elements positioned.

results matching ""

    No results matching ""