Flex Gumbo中如何通过textAlpha样式,设置TextGraphic透明度

本文介绍了一个使用Flex实现的示例程序,该程序通过滑块实时调整两个文本框的透明度,演示了如何在设备字体和嵌入式字体中应用这一特性。这有助于开发者了解文本透明度设置的方法及其对不同字体类型的影响。

main.mxml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FxApplicationname="TextGraphic_textAlpha_test"
  3. xmlns="http://ns.adobe.com/mxml/2009">
  4. <layout>
  5. <BasicLayout/>
  6. </layout>
  7. <Style>
  8. @font-face {
  9. src: url("assets/ARIAL.TTF");
  10. fontFamily: "ArialEmbedded";
  11. cff: true;
  12. }
  13. TextGraphic {
  14. fontSize: 24;
  15. }
  16. </Style>
  17. <HGroupleft="10" top="10">
  18. <Labeltext="textAlpha:" />
  19. <FxHSliderid="slider"
  20. minimum="0.0"
  21. maximum="1.0"
  22. value="1.0"
  23. stepSize="0.1"
  24. valueInterval="0.1"
  25. liveDragging="true"/>
  26. </HGroup>
  27. <Formid="form"
  28. horizontalCenter="0"
  29. verticalCenter="0">
  30. <FormItemlabel="device:">
  31. <Graphic>
  32. <TextGraphicid="deviceTextGraphic"
  33. textAlpha="{slider.value}"
  34. fontFamily="Arial"
  35. fontLookup="device"
  36. width="300">
  37. <text>The quick brown fox jumped over the lazy dog.</text>
  38. </TextGraphic>
  39. </Graphic>
  40. </FormItem>
  41. <FormItemlabel="embeddedCFF:">
  42. <Graphic>
  43. <TextGraphicid="embeddedTextGraphic"
  44. textAlpha="{slider.value}"
  45. fontFamily="ArialEmbedded"
  46. fontLookup="embeddedCFF"
  47. width="300">
  48. <text>The quick brown fox jumped over the lazy dog.</text>
  49. </TextGraphic>
  50. </Graphic>
  51. </FormItem>
  52. </Form>
  53. </FxApplication>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值