Flex学习笔记-08画图

1、线样式定义。

 

Packagegraphics
Classpublic class LineStyle
InheritanceLineStyle --> Object
ImplementsILineStyle

Defines the line style of the vector shapes. See the flash.display.graphics.lineStyle method. ( 定义线矢量形状样式。)

 

LineStyle(thickness:Number, color:uint = 0, alpha:Number = 1.0, pixelHinting:Boolean = false, scaleMode:String = normal, caps:String = null, joints:String = null, miterLimit:Number = 3)
 
   
  alpha : Number
定义线颜色透明度。  取值范围[0,1],  0完全透明,1完全不透明。 设置值小于0则取值0,设置值大于1则取值1。
A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.  
LineStyle
  caps : String
定义线头线尾的覆盖样式。 取值范围:"none" :正常 ; "round" :以线宽为直径凸出半圆样;"square" :以线宽为宽凸出几个像素单位的方形。
A value from the CapsStyle class that specifies the type of caps at the end of lines. Valid values are : CapsStyle.NONE, CapsStyle.ROUND, and CapsStyle.SQUARE. If a value is not indicated, Flash uses round caps.
LineStyle
  

color : uint  

线颜色定义。

A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on.

If a value is not indicated, the default is 0x000000 (black).

LineStyle
  

joints : String

多线相连场景下连接点的覆盖样式。取值大小写敏感。"round":圆弧形状(默认), "miter":角度形状,"bevel":按水平或垂直线磨平角度。

A value from the JointStyle class that specifies the type of joint appearance used at angles. Valid values are: JointStyle.BEVEL, JointStyle.MITER, and JointStyle.ROUND. If a value is not indicated, Flash uses round joints.
LineStyle
  

miterLimit : Number  

多线连接场景下基于连接点,角度可延伸出的最大极限像素因子(距离=thickness*miterLimit),如有多出部分做截断处理。仅当joints="miter"时有效。

A number that indicates the limit at which a miter is cut off. Valid values range from 1 to 255 (and values outside of that range are rounded to 1 or 255). This value is only used if the jointStyle is set to "miter". The miterLimit value represents the length that a miter can extend beyond the point at which the lines meet to form a joint. The value expresses a factor of the line thickness. For example, with a miterLimit factor of 2.5 and a thickness of 10 pixels, the miter is cut off at 25 pixels.

LineStyle
  pixelHinting : Boolean
是否清晰展示斜线的锯齿,true: 显示锯齿,false: 钝化锯齿。
A Boolean value that specifies whether to hint strokes to full pixels.This affects both the position of anchors of a curve and the line stroke size itself. \With pixelHinting set to true, Flash Player hints line widths to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines.
LineStyle
  

scaleMode : String

定义线缩放设置项。

A value from the LineScaleMode class that specifies which scale mode to use :
  • "normal"—Always scale the line thickness when the object is scaled (the default).  同步线宽缩放
  • "none"—Never scale the line thickness. 不同步线宽的缩放
  • "vertical"—Do not scale the line thickness if the object is scaled vertically only.  画布仅仅垂直缩放时,不同步线宽的缩放 画布缩放时,线宽是否同步缩放。
LineStyle
  thickness : Number

An integer that indicates the thickness of the line in points ; valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value of less than 0 is passed, the default is 0. The value 0 indicates hairline thickness ; the maximum thickness is 255. If a value greater than 255 is passed, the default is 255.

定义线宽。 有效取值范围:[0,255],设置值小于0则取值0,设置值大于255则取值255。设置0值等价于取值最小线宽(一般为1)。

 应用示例--线宽为8,红色,半透明,不显示锯齿,不缩放,多线连接点为角度形状,角度最大延伸像素因子2(最大延伸像素值=8*2=16):

graphics.lineStyle(8,0xFF0000,0.5,false,"none","none","miter",2));  
graphics.moveTo(point1.X, point1.Y);

graphics.lineTo(point2.X, point2.Y);
graphics.lineTo(point3.X, point3.Y);

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值