Flex Gumbo中如何利用blendMode属性给Ellipse对象设置融合模式的例子

By Minidxer | May 28, 2009

接下来的例子演示了Flex Gumbo中如何利用blendMode属性,给Ellipse对象设置融合模式。

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


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

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FxApplication name="Ellipse_blendMode_test"
  3.         xmlns="http://ns.adobe.com/mxml/2009">
  4.  
  5.     <Form>
  6.         <FormItem label="blendMode:">
  7.             <ComboBox id="comboBox">
  8.                 <dataProvider>
  9.                     <String>{BlendMode.ADD}</String>
  10.                     <String>{BlendMode.ALPHA}</String>
  11.                     <String>{BlendMode.DARKEN}</String>
  12.                     <String>{BlendMode.DIFFERENCE}</String>
  13.                     <String>{BlendMode.ERASE}</String>
  14.                     <String>{BlendMode.HARDLIGHT}</String>
  15.                     <String>{BlendMode.INVERT}</String>
  16.                     <String>{BlendMode.LAYER}</String>
  17.                     <String>{BlendMode.LIGHTEN}</String>
  18.                     <String>{BlendMode.MULTIPLY}</String>
  19.                     <String>{BlendMode.NORMAL}</String>
  20.                     <String>{BlendMode.OVERLAY}</String>
  21.                     <String>{BlendMode.SCREEN}</String>
  22.                     <String>{BlendMode.SHADER}</String>
  23.                     <String>{BlendMode.SUBTRACT}</String>
  24.                 </dataProvider>
  25.             </ComboBox>
  26.         </FormItem>
  27.     </Form>
  28.  
  29.     <Ellipse id="ellipse1"
  30.             width="100"
  31.             height="100"
  32.             horizontalCenter="-25"
  33.             verticalCenter="-25">
  34.         <fill>
  35.             <SolidColor color="red" />
  36.         </fill>
  37.     </Ellipse>
  38.  
  39.     <Ellipse id="ellipse2"
  40.             width="100"
  41.             height="100"
  42.             horizontalCenter="25"
  43.             verticalCenter="-25">
  44.         <fill>
  45.             <SolidColor color="blue" />
  46.         </fill>
  47.     </Ellipse>
  48.  
  49.     <Ellipse id="ellipse3"
  50.             blendMode="{comboBox.selectedItem}"
  51.             width="100"
  52.             height="100"
  53.             horizontalCenter="0"
  54.             verticalCenter="25">
  55.         <fill>
  56.             <SolidColor color="green" />
  57.         </fill>
  58.     </Ellipse>
  59.  
  60. </FxApplication>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

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

Search Posts