Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support importing a background to canvas #7

Open
omidaminiva opened this issue Apr 2, 2015 · 10 comments
Open

support importing a background to canvas #7

omidaminiva opened this issue Apr 2, 2015 · 10 comments
Assignees
Milestone

Comments

@omidaminiva
Copy link

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.

@PaNaVTEC
Copy link
Owner

PaNaVTEC commented Apr 3, 2015

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.

@PaNaVTEC PaNaVTEC self-assigned this Apr 3, 2015
@omidaminiva
Copy link
Author

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.

@PaNaVTEC PaNaVTEC modified the milestones: 0.6, 0.7 Apr 4, 2015
@PaNaVTEC
Copy link
Owner

PaNaVTEC commented Apr 5, 2015

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.

@omidaminiva
Copy link
Author

I tried the bg color and border and it works great.

@jongha
Copy link

jongha commented Nov 1, 2015

Nice. When it will stable release?

@amigax
Copy link

amigax commented Sep 26, 2017

did this ever get done ?

@PaNaVTEC
Copy link
Owner

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 👍

@amigax
Copy link

amigax commented Sep 26, 2017

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.

@amigax
Copy link

amigax commented Sep 27, 2017

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.

@JorgeAmVF
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants