DrawableView
DrawableView copied to clipboard
support importing a background to canvas
Is there any way to support importing a background to canvas. I tried to put an imageview behind deawableview and then get both bitmaps and overlay each other. How ever problem happens when image and canvas of drawableview are bigger than screen.
At this time you can use "drawableView.setBackground..." But I don't think is a good idea because at each draw will re-paint the background + gestures. I will think on that.
yes I agree it is not a good idea since you cannot choose the scaletype for background. I will look forward to see this feature on this library.
In the develop branch you can set background color and border color for canvas. I will look for a better solution for draw a bitmap.
I tried the bg color and border and it works great.
Nice. When it will stable release?
did this ever get done ?
As I was saying previously, nothing stops you to do: drawableView.setBackground...
The optimization for that never got implemented, feel free to submit PRs with a better implementation, I will gladly take a look and merge it :+1:
Thanks I managed to hack a solution together, will make it more elegant. But basically it involves painting a bitmap and scaling it up to the canvas size, it runs fast if the bitmap is not huge :) Great lib btw, thank you for your hard work.
Actually I really cannot understand why the background is getting scaled each time even when it is in a different view behind this one. Real shame.
I tried the bg color and border and it works great.
@omidaminiva, could you, please, inform how did you achieve that?
I tried using the develop-branch
methods, however, I couldn't achieve that not even by setting the background programatically as it gets the color, but when I save the image into the gallery, it gets a black background as if it's transparent and whether I set the background from the layout it gets over the drawing stroke.
I might be overlooking something, so any help would be appreciated.