Flex Gumbo中如何通过joints属性设置LinearGradientStroke对象连接样式(joint style)的例子

By Minidxer | June 16, 2009

接下来的例子演示了Flex Gumbo中如何通过joints属性,设置LinearGradientStroke对象连接样式。

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


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

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Application name="LinearGradientStroke_joints_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009"
  4.         layout="vertical"
  5.         verticalAlign="middle"
  6.         backgroundColor="white">
  7.  
  8.     <ApplicationControlBar dock="true">
  9.         <Form styleName="plain">
  10.             <FormItem label="joints:">
  11.                 <ComboBox id="comboBox"
  12.                         dataProvider="[bevel,miter,round]" />
  13.             </FormItem>
  14.         </Form>
  15.     </ApplicationControlBar>
  16.  
  17.     <Graphic>
  18.         <Rect id="rect" width="300" height="200">
  19.             <stroke>
  20.                 <LinearGradientStroke id="linearGrad"
  21.                         joints="{comboBox.selectedItem}"
  22.                         weight="20">
  23.                     <entries>
  24.                         <GradientEntry color="red" />
  25.                         <GradientEntry color="white" />
  26.                         <GradientEntry color="blue" />
  27.                     </entries>
  28.                 </LinearGradientStroke>
  29.             </stroke>
  30.         </Rect>
  31.     </Graphic>
  32.  
  33. </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

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

Search Posts