android
Bitmap Shader with alpha channel. (Alpha is drawing black..?)
I get my bitmap, use it as a shader tile mode. The PNG is mostly alpha except for the shape outline to draw. Except it draws the outline, but is surrounded by black, not seethrough (alpha). pnt.reset(); if(backgroundColor == 1) { pnt.setColor(myColor); pnt.setStyle(Paint.Style.FILL); } m_canvas.drawPath(path, pnt); //fillBMP = getBitmapFromAsset(m_context, "brush.png"); fillBMP = BitmapFactory.decodeFile(mySDPath + "brush.png"); fillBMPshader = new BitmapShader(fillBMP, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); pnt.setShader(fillBMPshader); m_canvas.drawPath(path, pnt); Example below of the brush on left. But result it draws on right.
You should set XferMode on your Paint object. More specifically you got to use PorterDuffXferMode MULTIPLY. Here is a similar question : Android color overlay - PorterDuff modes
Related Links
Viewpager in a fragment
Wondering how Arrayadapter work
Check file before to download
My SQL statement does not return any data from table in android with SQLite
Moving files within SD card
Android SQLite Exception no such column while inserting
Disable/Enable Image loading Onclick- Webview Android
Android Application not connecting to HTTPS using self signed certificate
How to display Login wise data in whole application?
Why does an Android activity choose to call destroy() rather than just stay in the paused state?
Android AutoCompleteTextView: How to make sure the value entered is from the suggestion provided?
css style let webview show blank, only in 4.4(android kitkat)
Android download images from a public dropbox folder
recording a local webrtc stream on android
Sherlock Action Bar - actionBarSize does not change
Google Maps Android doesn't show on screen