Flex Gumbo中如何通过miterLimit属性设置Path stroke的例子

By Minidxer | June 23, 2009

接下来的例子演示了Flex Gumbo中如何通过miterLimit属性,设置Path stroke。

让我们先来看一下Demo可以点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Application name="Path_stroke_miterLimit_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009"
  4.         layout="vertical"
  5.         verticalAlign="middle"
  6.         backgroundColor="white">
  7.  
  8.     <Declarations>
  9.         <String id="pathData">M 0 0 L 200 0 L 0 80 Z</String>
  10.     </Declarations>
  11.  
  12.     <ApplicationControlBar dock="true">
  13.         <Form styleName="plain">
  14.             <FormItem label="miterLimit:">
  15.                 <HSlider id="slider"
  16.                         minimum="0"
  17.                         maximum="10"
  18.                         value="0"
  19.                         tickInterval="1"
  20.                         liveDragging="true" />
  21.             </FormItem>
  22.         </Form>
  23.     </ApplicationControlBar>
  24.  
  25.     <Graphic>
  26.         <Path id="path" data="{pathData}">
  27.             <stroke>
  28.                 <SolidColorStroke id="pathStroke"
  29.                         joints="miter"
  30.                         miterLimit="{slider.value}"
  31.                         color="red"
  32.                         weight="40" />
  33.             </stroke>
  34.         </Path>
  35.         <Path data="{pathData}">
  36.             <stroke>
  37.                 <SolidColorStroke
  38.                         color="black"
  39.                         weight="1" />
  40.             </stroke>
  41.         </Path>
  42.     </Graphic>
  43.  
  44. </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Gumbo, Other | No Comments » | Tags: , , , , ,

Search Posts