Hi I want to convert normal image into mirror i.e flop effect in BLACKBERRY app.I have tried this code but unable too convert…Is there anyone to help me to do this…
If you have a different logic to do this please share..
public Bitmap changetoFlopEffect(Bitmap bitmap){
int[] argb = new int[bitmap.getWidth() * bitmap.getHeight()];
int[] newargb =new int[bitmap.getWidth() * bitmap.getHeight()];
int length=bitmap.getWidth();
bitmap.getARGB(argb, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
for(int i=0;i<=bitmap.getHeight();i++)
{
for(int j=bitmap.getWidth(),k=0;j>0;j--)
{
//newargb[k]=argb[j];
int swap=argb[j];
newargb[k]=swap;
k++;
}
}
bitmap.setARGB(newargb,0,bitmap.getWidth(),0,0,bitmap.getWidth(),bitmap.getHeight());
return bitmap;
}
Your corner conditions seem wrong and the pixels you swipe are from the first row only. Try this: