【发布时间】:2017-03-01 09:04:54
【问题描述】:
使用 Rect 基元,您可以使用像 so 这样的位图数据来定义填充。
<!-- Draw rectangle that is filled with a repeating bitmap. -->
<s:Rect height="100" width="200">
<s:stroke>
<s:SolidColorStroke color="0x000000" weight="2"/>
</s:stroke>
<s:fill>
<s:BitmapFill
source="@Embed('../assets/AirIcon12x12.gif')"
fillMode="repeat"/>
</s:fill>
</s:Rect>
看起来像这样:
有没有办法为边框笔划定义位图填充(并且中心是透明的)?
【问题讨论】:
-
我会使用带有两个矩形的“假”边框,背景一个正常填充透明边框,内部和前景矩形填充白色透明边框。
-
我赞同@Vesper 的建议。在 Flex 之外,我会制作两个矩形,一个是位图填充的,另一个(轮廓)用作位图的蒙版。这将给出仅具有位图填充的边框的视觉效果(因为填充仅通过轮廓显示)。
-
嗯,掩码是更好的方法,因为掩码不会被绘制。不错的@VC.One
-
@Vesper 我遇到的一个问题是笔划位于矩形边缘的顶部。我找不到指定位置的方法,所以我最终使用了掩码。
标签: actionscript-3 flash apache-flex flex4 fxg