Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/07/2009, 10:17
Avatar de NaRanJiTo78
NaRanJiTo78
 
Fecha de Ingreso: noviembre-2007
Ubicación: In the BeaCh
Mensajes: 874
Antigüedad: 16 años, 6 meses
Puntos: 10
Respuesta: Calidad en png?? (CS4)

El código sería:

Cita:
var bmp:Bitmap = new Bitmap(null,true);
trace(bmp.smoothing); // true
bmp.bitmapData = bmpd;
trace(bmp.smoothing); // false
Como puedo solucionarlo con AS2, que es lo que tengo?

Puede ser algo así?

Cita:
import flash.display.BitmapData;

class com.awen.utils.BitmapUtils
{
/** Workaround for a bug in AS2 whereby it's impossible to add smoothing to
* a loaded bitmap (i.e. one that's not in the library).
* @param target The loaded bitmap - calling this in onLoadInit would be appropriate.
*/
public static function smoothLoadedBitmap(target:MovieClip):Void
{
// Adjust scaling to make sure we're getting as
// high res a copy as possible
var xs:Number=target._xscale;
var ys:Number=target._yscale;
target._xscale=100;
target._yscale=100;
// Copy the loaded bitmap into a new bitmap
var bitmap:BitmapData=new BitmapData(target._width,target._height,true,0);
bitmap.draw(target);
// Paste it over the top of the loaded bitmap - as a child MC.
var mc:MovieClip=target.createEmptyMovieClip(target._n ame+"bmap",target.getNextHighestDepth());
mc.attachBitmap(bitmap,100,"never",true); // The critical parameter is 'true' - this allows smoothing
// The next two lines ensure the bitmap data gets disposed when the clip is unloaded.
mc.bitmap=bitmap;
mc.onUnload=function(){this.bitmap.dispose();}
// Reset scaling
target._xscale=xs;
target._yscale=ys;
}
}
No se que falla que no va...