In Android, I'm trying to create two images (in this case, the Bitmap object) in FrameLayout. An image is placed on top, the other image is inserted beneath it in the first pixel transparent image.
Currently, I'm trying to use Bitmap.getPixel () to determine the transparent pixels.
Currently, I'm trying to use Bitmap.getPixel () to determine the transparent pixels.
for (int i = 0; i < image_count; i++)Then I add the image to the frame layout, using two ImageView and use these values to position the image below:
{
//load page from internal memory
topImages[i] = getImage("p"+i+".png");
for (int x = 0; x < topImages[i].getWidth(); x++)
{
for (int y = 0; y < topImages[i].getHeight(); y++)
{
if (topImages[i].getPixel(x, y) == Color.TRANSPARENT)
{
bottomX[i] = x;
bottomY[i] = y;
break;
}
}
}
}
bottomView.setTranslationX(bottomX[position]);However, the location of the pictures below are incorrect, usually due to down and right margins of different (but always the same) for each certain picture. I also tried setX () and sety (), as well as the parameters used to set values and LEFT TOP similar, with the same result). What can I do to ensure that consistent position, with the top left corner at (or near) the first pixel transparent?
bottomView.setTranslationY(bottomY[position]);
Nice Article Friend, Visit my Website For fresh
ReplyDeleteTechnology Related Article