开发者

Why embed PNG in Action Script looks pixelated when added to a stage?

Here is what I do:

 package
{
    import flash.display.Bitmap;
    import flash.display.Sprite;

    public class Loading extends Sprite
    {
        [Embed(source="loading.png")]
        private var MyLoading : Class;
        private var spinner:Bitmap;
...

        public function MoxieLoading(center:Point)
        {           
            spinner = new MyLoading;
            addChild(spinner);
...

And when my loading png finally appears it looks like a poorly indexed GIF, especially on edges. Why is it happening? I'm using Bitmap class here, maybe there is something better? C开发者_运维知识库an I control quality?


Are there any scaling going on? Try Bitmap smoothing:

myBitmap.smoothing = true;


  1. Make sure the png is of good quality;
  2. Check if you don't modify spinner width, height, scale, filters;
  3. Place it on even position, that is x = 50 not x= 50.5;

But overall it seems like a problem with the actual picture, not flash. I never ever had any problems with embeded PNGs, maybe the program in which you saved it did it in some funky way?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜