I want to load an icon from resource and draw over it. But I cannot
get it into a canvas. Can anyone please help me with the code below.
If I uncomment c.drawColor(), I get blue color as expected. So the
problem is on icon.draw().
Drawable icon = getResources().getDrawable(R.drawable.icon2);
Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(),
icon.getIntrinsicHeight(),
Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
icon.draw(c);
//c.drawColor(Color.BLUE);
ImageView iv = (ImageView)findViewById(R.id.icon);
iv.setImageBitmap(bitmap);
Thanks,
Jay
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---