Skip to main content
BladePoint
Inspiring
April 9, 2013
Answered

Vector Art to Bitmap - Quality Settings

  • April 9, 2013
  • 1 reply
  • 880 views

I have some vector art in a sprite that I make into a bitmap like so:

var mySprite:Sprite = new myVectorSprite();

var mySpriteBMD = new BitmapData(800,600,true,0x00ffffff);

mySpriteBMD.draw(mySprite);

I just noticed that if the SWF quality settings are set to low when that occurs, the bitmap will look like crap as well. And since it is already drawn, if the user sets the quality back to high, everything else will be in high quality except for that bitmap. Is there a way to force it to draw the bitmap in high quality and then set the quality back to whatever the user had it set to?

This topic has been closed for replies.
Correct answer BladePoint

Bitmapdata.drawWithQuality is what I was looking for. So my code ends up as this:

var mySprite:Sprite = new myVectorSprite();

var mySpriteBMD = new BitmapData(800,600,true,0x00ffffff);

mySpriteBMD.drawWithQuality(mySprite,null,null,null,null,false,StageQuality.HIGH);

1 reply

kglad
Community Expert
Community Expert
April 9, 2013

no, you can't override the user's settings. but you may be able to listen to a settings change and then redraw your sprite.

BladePoint
BladePointAuthorCorrect answer
Inspiring
April 27, 2013

Bitmapdata.drawWithQuality is what I was looking for. So my code ends up as this:

var mySprite:Sprite = new myVectorSprite();

var mySpriteBMD = new BitmapData(800,600,true,0x00ffffff);

mySpriteBMD.drawWithQuality(mySprite,null,null,null,null,false,StageQuality.HIGH);

Participating Frequently
May 2, 2013

also use bitmap.smoothing =  true.