简体   繁体   中英

how to smooth an embeded image in flex when its embed as a class for textinput border style

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

No need to do much for smoothing image just

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

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM