CustomViews
CustomViews copied to clipboard
image size issue
I think there's a bug in the onsizechanged, line 112, it's setting bitH to mBitmap.getWidth(), shouldn't it be getHeight()?. If original height was bigger than width, I think it make the new bitmap too small. I only noticed once I copied that code to create a new output bitmap with a white background instead of transparent. Also, I'd like to use this code in a commercial app, is that ok?
You are absolutely right about the size difference issue. If you can put it in a pull request I will merge the change in and mark this as closed.
As for the output bitmap, I recommend not modifying the background from in within the view. Rather, get the bitmap with the transparent background and draw it onto another bitmap with the background you desire. This isn't entirely clear in the demo or documentation, but the transparent background allows you to modify the signature easily if your capture format doesn't match a required output format (ie. capture white on black, get white signature with transparent background, invert signature, draw the (now black) signature onto a white background).
Feel free to use the code in a commercial app (let me know about it when you release if you can). If there is an issue with the current licensing situation (DWTFYWWI) please open another issue.