I'm trying to load a png file from the library into a bitmap data, but get an EOF error when trying to do so.
End of file was encountered. at flash.display::BitmapData/setPixels()
I've added comments with the values used in the code below.
var bitmapData_texture:BitmapData = new BitmapData(image.width, image.height, true, 0x0);
bitmapData_texture.draw(image);
var pixels:ByteArray = bitmapData_texture.getPixels(rect_bmp);
var bitmapData:BitmapData = new BitmapData(rect_bmp.width,rect_bmp.height,true,0x0);
trace("image width : "+image.width.toString()); //image width : 161
trace("image height: "+image.height.toString()); //image height: 171
trace("rect x : "+rect_bmp.x.toString()); //rect x : 0
trace("rect y : "+rect_bmp.y.toString()); //rect y : 0
trace("rect width : "+rect_bmp.width.toString()); //rect width : 161
trace("rect height : "+rect_bmp.height.toString()); //rect height : 2
trace("bmpd width : "+bitmapData.width.toString()); //bmpd width : 161
trace("bmpd height : "+bitmapData.height.toString()); //bmpd height : 2
bitmapData.setPixels(rect_bmp,pixels);