当将其嵌入为文本输入边框样式的类时,如何平滑 Flex 中的嵌入图像

发布于 2024-09-09 22:43:39 字数 469 浏览 2 评论 0原文

你好,我的 stackoverflower 同胞,

我正在寻找平滑图像并嵌入 png 文件的方法。 我使用嵌入的 png 作为我的文本输入的边框。

我看过一些关于这个主题的其他帖子,但我能弄清楚。有谁有想法,我怎样才能完成这个?一些真正可靠的代码示例会很好。

这就是我想做的。

步骤1)嵌入和图像

    [Embed(source='assets/images/searchBoxImg.png')]
    private var searchBG:Class;  

步骤2)以某种方式平滑图像?

步骤 3) 并将其用作我的 textInput 的边框。

        this.setStyle('borderSkin',searchBG);

有没有人可以帮助我解决这个问题?

DJ

Hello my fellow stackoverflower,

i'm looking for away to smooth an image of and embed png file.
i'm using the embeded png as the borderskin for my textInput.

i have seen some other postings about this subject but i can figure it out. Does anybody have an idea, how i can a complish this? some real solid code example wwould be nice.

this is what i would like to do.

step 1) embed and image

    [Embed(source='assets/images/searchBoxImg.png')]
    private var searchBG:Class;  

step 2) smooth the image somehow?

step 3) and us it as a borderskin for my textInput.

        this.setStyle('borderSkin',searchBG);

is there anybody out there that can help me with this?

DJ

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

高速公鹿 2024-09-16 22:43:39

不需要做太多的平滑图像只是

[Embed(source='assets/images/searchBoxImg.png'),smoothing='true']

No need to do much for smoothing image just

[Embed(source='assets/images/searchBoxImg.png'),smoothing='true']

む无字情书 2024-09-16 22:43:39

好吧,我很好地找到了解决方案。实际上,在类中平滑和嵌入图像非常简单。

步骤一)创建一个扩展 BitmapAsset 的新动作脚本类。

步骤二)嵌入和图像并将平滑设置为 true

package 
{
    import mx.core.BitmapAsset;

    [Embed(source='assets/images/searchBoxImg.png')]
    public class searchBG extends BitmapAsset
    {
        public function searchBG()
        {
            smoothing = true;
        }
    }
}

步骤三)创建一个新的 as3 类并导入第一个类。

现在您可以在 borderSkin 上使用 searchBG 类。

this.setStyle('borderSkin', searchBG);

就是这样。

Well i finelly found a solution. Actually is pretty simpel to smooth and embeded image in a class.

Step one) create an new actionscript class that extends BitmapAsset.

Step two) Embed and image and set smoothing to true

package 
{
    import mx.core.BitmapAsset;

    [Embed(source='assets/images/searchBoxImg.png')]
    public class searchBG extends BitmapAsset
    {
        public function searchBG()
        {
            smoothing = true;
        }
    }
}

Step three) Create a new as3 class and import the first class.

now you are able to use the searchBG Class on the borderSkin.

this.setStyle('borderSkin', searchBG);

thats it.

冰葑 2024-09-16 22:43:39

克里斯的回答原则上是正确的。
正确的语法是:

[Embed(source='assets/images/searchBoxImg.png',smoothing='true')]

The answer from Chris is in principle right.
The correct syntax is:

[Embed(source='assets/images/searchBoxImg.png',smoothing='true')]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文