Bitmapdata scale9
Hello I am wanting to use a scale9grid method to resize images. Is this part of the nme api not yet implemented in jeash?
For example this works with flash and cpp but not the html5;
public static function scale9Bitmap (w:Int,
var bmpData:BitmapData = new BitmapData (w,h,true,
var rows:Array<Float> = [0,_scale9Grid.
var cols:Array<Float> = [0,_scale9Grid.
var dRows:Array<Float> = [0,_scale9Grid.
var dCols:Array<Float> = [0,_scale9Grid.
var origin:Rectangle;
var draw:Rectangle;
var mat:Matrix = new Matrix ();
var cx:Int = 0;
while (cx < 3) {
var cy:Int = 0;
while (cy < 3) {
origin = new Rectangle (cols[cx]
draw = new Rectangle (dCols[
mat.identity ();
mat.a = draw.width / origin.width;
mat.d = draw.height / origin.height;
mat.tx = draw.x - origin.x * mat.a;
mat.ty = draw.y - origin.y * mat.d;
bmpData.draw (originalBitmap
cy ++;
}
cx ++;
}
return bmpData;
}
Question information
- Language:
- English Edit question
- Status:
- Open
- For:
- jeash Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask chris for more information if necessary.