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

Categories

HOME
beautifulsoup
microsoftgraph
paraview
spark-streaming
jmeter
error-handling
vxml
nuget-package
jtextpane
lanczos
p2p
fabric.io
dkim
appcelerator-studio
mautic
opengl-es-3.0
php-5.6
mongodb-csharp
altera
null-pointer
cfml
backpack-for-laravel
postscript
zxing
jquery-callback
dapper-extensions
pic32
stackexchange
bulletphysics
userdefaults
recurring-events
anki
login-script
getlasterror
hivemq
ideascript
ogc
parser-generator
chronicle-map
knime
rfc3339
x++
double-click
identification
posixct
zenhub
amq
context-switch
custom-font
gpg-signature
branch-prediction
cvxpy
qtplugin
segment-io
beamer
avspeechsynthesizer
google-query-language
spreadjs
ellucian-scribe
np-spring
kendo-upload
state-restoration
vhosts
toran-proxy
forwarding
sha512
telepat
fail2ban
zend-currency
java-security
apache-spark-1.3
appserver
paw
ray
dot42
git-repo
windows-embedded-standard
gwt-openlayers
sphinxql
virtual-pc
asplinkbutton
tree-balancing
frameworkelementfactory
qi4j
pstack
fragmenttransaction
monotouch.dialog
uimanageddocument
dajaxice
thttpd
appjs
database-create
floating-point-exceptions
xcelsius
automationelement
drawtobitmap
nhprof
resharper-6.0
updatesourcetrigger

Resources

Encrypt Message