Hi,
I just found this topic by searching for another
I already had this issue 3 years ago, on a software that renders some kind of slideshow, and the pictures were uploaded at a super size, 8000x6000, and rendered then on a 1024x768 monitor.
I’ve used an iterative scale on bitmap, up or down, till I reached the desired resolution; for me, this works well at the value 1.75 for the multiplier.
I’ve attached down the code for you. Hope it helps you.
You should try with any value greater than 1 for multiplier.
private static var matrix:Matrix = new Matrix();
public static function scaleBitmapDataBilinearIterative(source:BitmapData, width:Int, height:Int, iterationMultiplier:Float=1.75):BitmapData
{
var w:Int = source.width;
var h:Int = source.height;
var result:BitmapData = null;
while (result == null || w != width || h != height) {
w = source.width > width ? Std.int(Math.max(w / iterationMultiplier, width)) : Std.int(Math.min(w * iterationMultiplier, width));
h = source.height > height ? Std.int(Math.max(h / iterationMultiplier, height)) : Std.int(Math.min(h * iterationMultiplier, height));
var newResult:BitmapData = scaleBitmapDataBilinear(result != null ? result : source, w, h);
if (result != null) {
result.dispose();
}
result = newResult;
}
return result;
}
private static function scaleBitmapDataBilinear(source:BitmapData, width:Int, height:Int):BitmapData
{
var result:BitmapData = new BitmapData(width, height);
matrix.identity();
matrix.scale(width / source.width, height / source.height);
result.draw(source, matrix, null, null, null, true);
return result;
}