Flex Gumbo中如何利用scaleMode属性创建比例尺模式(scale mode)Ellipse对象的例子
By Minidxer | June 20, 2009
接下来的例子演示了Flex Gumbo中如何利用在scaleMode属性上设置LineScaleMode类,创建比例尺模式(scale mode)Ellipse对象。
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <Application name="Ellipse_stroke_scaleMode_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <ApplicationControlBar dock="true">
- <Form styleName="plain">
- <FormItem label="scaleMode:">
- <ComboBox id="comboBox" selectedIndex="1">
- <dataProvider>
- <Array>
- <String>{LineScaleMode.NONE}</String>
- <String>{LineScaleMode.NORMAL}</String>
- <String>{LineScaleMode.HORIZONTAL}</String>
- <String>{LineScaleMode.VERTICAL}</String>
- </Array>
- </dataProvider>
- </ComboBox>
- </FormItem>
- <FormItem label="scaleX:">
- <HSlider id="xSlider"
- minimum="1"
- maximum="5"
- value="1"
- tickInterval="1"
- liveDragging="true" />
- </FormItem>
- <FormItem label="scaleY:">
- <HSlider id="ySlider"
- minimum="1"
- maximum="5"
- value="1"
- tickInterval="1"
- liveDragging="true" />
- </FormItem>
- </Form>
- </ApplicationControlBar>
- <Graphic>
- <Ellipse id="ellipse"
- width="80"
- height="60"
- scaleX="{xSlider.value}"
- scaleY="{ySlider.value}">
- <stroke>
- <SolidColorStroke id="lineStroke"
- scaleMode="{comboBox.selectedItem}"
- weight="10" />
- </stroke>
- </Ellipse>
- </Graphic>
- </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Ellipse, Gumbo |
No Comments » |
Tags: Ellipse, Gumbo, LineScaleMode, scaleMode, scaleX, scaleY, SolidColorStroke, stroke