Android : How to set Canvas to Non transaparent Image?

on Friday, March 20, 2015


i have a bitmap of size 400*100. Now i want to increase the bitmap size to 400*200 with empty white space on bottom. i tried the below code, but its creating transaparent space, not white space.


=== My Code ===


// oldBitMap size are 400(width) and 100(height)


Bitmap newBitmap = Bitmap.createBitmap(400, 200, oldBitMap.getConfig());


Canvas canvas = new Canvas(newBitmap);


canvas.drawColor(Color.WHITE);


canvas.drawBitmap(oldBitMap, 0, 0, null);


Help Please....


0 comments:

Post a Comment