z wrote:
> Can you post full codes, I couldnt get your snippet to work.
>

sure, it has also nice alpha blending effect

Bitmap reflectedBitmap = Bitmap.createBitmap(originalBitmap.getWidth
(), originalBitmap.getHeight(), Config.ARGB_8888);
Canvas c = new Canvas(reflectedBitmap);
c.save();
c.scale(1, -1);
// draw mirrored bitmap
c.drawBitmap(originalBitmap, 0, -originalBitmap.getHeight(), null);
c.restore();
// apply alpha gradient
Paint paint = new Paint();
LinearGradient shader = new LinearGradient(0, 0, 0,
originalBitmap.getHeight()*0.75f, 0x80ffffff, 0x00ffffff,
TileMode.CLAMP);
paint.setShader(shader);
paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));
c.drawRect(0, 0, originalBitmap.getWidth(), originalBitmap.getHeight
(), paint);

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to