FREBitmapData.acquire() occure error..#3503
Hello..
I want to send image from flash to native extension..
so i call acquire() for FREBitmapData in native extension code..
but The Code is occuring the error below...
Error: Error #3503: The extension was left in an invalid state.
Why does this error occur?..
The source code is below..
[FLASH CODE]
protected function onMouseDownHandler(event:MouseEvent):void
{
var bitmap:Bitmap = new IMAGE_FACE() as Bitmap;
faceDetector.findFace(bitmap.bitmapData);
}
[NATIVE CODE in Extension]
public FREObject call(FREContext freContext, FREObject[] arguments)
{
Log.i("air.extension", "[FaceDetector2.findFace()]");
try
{
FREBitmapData freBitmapData = (FREBitmapData) arguments[0];
freBitmapData.acquire(); <== ERROR : Error: Error #3503: The extension was left in an invalid state.
Log.i("air.extension", faceInfo.toString());
int width = freBitmapData.getWidth();
int height = freBitmapData.getHeight();
ByteBuffer byteBuffer = freBitmapData.getBits();
int[] buffer = byteBuffer.asIntBuffer().array();
faceInfo.nbFace = FaceEngine.FindFace(buffer, width, height, faceInfo);
}
catch (IllegalStateException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (FREInvalidObjectException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (FREWrongThreadException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
}
return null;
}
