Ameer Ali
- Forum posts: 1
Jan 27, 2014, 10:12:22 AM via Website
Jan 27, 2014 10:12:22 AM via Website
Hi,
I am developing android document image cropping.I have the custom camera and when i crop the image in rectangular the error detected "Java Binder !!!Failed Binder Transaction".I tried with several days...Please revert me.
I have the class DragRectView and activity CropImageActivity and MainActivity
CropImageActivity
if (null != view)
{
((DragRectView) view).setOnUpCallback(new DragRectView.OnUpCallback()
{
@Override
public void onRectFinished(final Rect rect)
{
Toast.makeText(
getApplicationContext(),
"Rect is (" + rect.left + ", " + rect.top + ", "
+ rect.right + ", " + rect.bottom + ")",
Toast.LENGTH_LONG).show();
Bitmap bitmap1 = Bitmap.createScaledBitmap(
((BitmapDrawable) original.getDrawable())
.getBitmap(), original.getWidth(), original
.getHeight(), false);
System.out.println(rect.height() + " "
+ bitmap1.getHeight() + " " + rect.width()
+ " " + bitmap1.getWidth());
if (rect.height() <= bitmap1.getHeight()
&& rect.width() <= bitmap1.getWidth())
{
Bitmap bitmap = Bitmap.createBitmap(bitmap1,
view.getLeft(), view.getTop(), view.getWidth(),
view.getHeight());
System.out
.println("MainActivity.onCreate(...).new OnUpCallback() {...}.onRectFinished() if true");
Intent intent = new Intent(MainActivity.this,
CropImageActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("byteArray", bitmap);
startActivity(intent);
System.out.println("MainActivity.onCreate() ");
}
}
});
}
}
Thanks
I am developing android document image cropping.I have the custom camera and when i crop the image in rectangular the error detected "Java Binder !!!Failed Binder Transaction".I tried with several days...Please revert me.
I have the class DragRectView and activity CropImageActivity and MainActivity
CropImageActivity
if (null != view)
{
((DragRectView) view).setOnUpCallback(new DragRectView.OnUpCallback()
{
@Override
public void onRectFinished(final Rect rect)
{
Toast.makeText(
getApplicationContext(),
"Rect is (" + rect.left + ", " + rect.top + ", "
+ rect.right + ", " + rect.bottom + ")",
Toast.LENGTH_LONG).show();
Bitmap bitmap1 = Bitmap.createScaledBitmap(
((BitmapDrawable) original.getDrawable())
.getBitmap(), original.getWidth(), original
.getHeight(), false);
System.out.println(rect.height() + " "
+ bitmap1.getHeight() + " " + rect.width()
+ " " + bitmap1.getWidth());
if (rect.height() <= bitmap1.getHeight()
&& rect.width() <= bitmap1.getWidth())
{
Bitmap bitmap = Bitmap.createBitmap(bitmap1,
view.getLeft(), view.getTop(), view.getWidth(),
view.getHeight());
System.out
.println("MainActivity.onCreate(...).new OnUpCallback() {...}.onRectFinished() if true");
Intent intent = new Intent(MainActivity.this,
CropImageActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("byteArray", bitmap);
startActivity(intent);
System.out.println("MainActivity.onCreate() ");
}
}
});
}
}
Thanks
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.