Open tnylee opened 5 years ago
Same problem here
I recently update snapshot version, please use it and tell me if the problem persists
Tried with the 1.0.2. The error is gone but the background image is not set. This is my code (Kotlin):
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_edit_picture)
val imagePath = intent.getStringExtra("imagePath")
edit_picture_view.backgroundImage(File(imagePath), BackgroundType.FILE, BackgroundScale.CENTER_INSIDE, 50)
}
Hi,
Just an fyi the same error manifests on line with code: "mZoomRegionView.drawZoomRegion(mContentBitmap, mCanvasClipBounds, 4);"
If you add a delay there is no error and it prevents the crash: new Handler().postDelayed(new Runnable() { @Override public void run() { mZoomRegionView.drawZoomRegion(mContentBitmap, mCanvasClipBounds, 4); } }, 1000);
Could you add this to the next version please?
Best wishes,
Arron
I have a solution.
drawingView.post { drawingView.setBackgroundImage(File(uri.path), BackgroundType.FILE, BackgroundScale.CENTER_INSIDE) }
thanks to byox great project, I cloned the project and fixed this bug. feel free to use it. implementation 'com.github.salario07:DrawView:1.0.4'
also see latest version from here: https://jitpack.io/#salario07/DrawView
Thank you for such an awesome library! Its helping me. However, an error occured while using it and I'd like to know if you can help me. Thanks!
java.lang.IllegalArgumentException: width and height must be > 0
Crashes on line
drawingView.setBackgroundImage(editingImage, BackgroundType.FILE, BackgroundScale.CENTER_INSIDE);
If removed, no error occurs.
My XML:
configuration code:
What am I doing wrong?