Friends, I have an andrid application to display an image on another. the second image's white colour should be converted in to transparent. so i used two imageviews. the original image to be overlayed is bitmap1. image after making transparent is bitmap2. when i run this i got some exceptios atsetPixel method. the code is shown below
Bitmap bitmap2 = null;
int width = imViewOverLay.getWidth();
int height = imViewOverLay.getHeight();
for(int x=0;x<width;x++)
{
for(int y=0;y<height;y++)
{
if(bitMap1.getPixel(x, y) == Color.WHITE)
{
bitmap2.setPixel(x, y, Color.TRANSPARENT);
}
else
{
bitmap2.setPixel(x, y, bitMap1.getPixel(x, y));
}
}
}
imViewOverLay
is the imageview of the over lay image.
anybody please help me to know the mistakes in above code