i have a two question.

first i want copy image in pixel by pixel

Bitmap mSnowflake = BitmapFactory.decodeResource(mContext.getResources
(), R.drawable.snowflake);
//mSnowflake is black background in white snowflake
Bitmap mChangedBitmap = Bitmap.createBitmap(mSnowflake.getWidth
(),mSnowflake.getHeight(),Config.ARGB_8888);

copyImage(mSnowflake,mChangedBitmap);

public void copyImage(Bitmap bmSrc,Bitmap bmDest){
    for(int x = 0x00; x <  bmSrc.getWidth(); x++){
        for(int y = 0x00; y < bmSrc.getHeight(); y++){
           bmDest.setPixel(x, y, bmSrc.getPixel(x, y));
        }
    }
}
i want SrcImage and DestImage very same but DestImage are not same
very slime snowflake
why loss color pixel in destImage i dont Know....

second i want change image color

Bitmap mSnowflake = BitmapFactory.decodeResource(mContext.getResources
(), R.drawable.snowflake);
//mSnowflake is black background in white snowflake
i want show red snowflake but <<check error

public void setAlpha(Bitmap bmSrc,int nOpacity){
  for(int x = 0x00; x <  bmSrc.getWidth(); x++){
    for(int y = 0x00; y < bmSrc.getHeight(); y++){
      int nColor =  bmSrc.getPixel(x,y);
      if(nColor != 0x00){
        bmSrc.setPixel(x, y, Color.RED);<< error
      }
   }
  }
}

thank you for read this thread!
have a nice day!
--~--~---------~--~----~------------~-------~--~----~
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