Creating Bitmap

To Create Bitmap 
Bitmap bmp = Bitmap.createBitmap((int)
getWindowManager().getDefaultDisplay().getWidth(), (int)
getWindowManager().getDefaultDisplay().getHeight(), Bitmap.Config.ARGB_8888);


To create Bitmap from resources

Bitmap image=BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_launcher); 


Bitmap Configurations:
 
ALPHA_8  : 8 bits on Alpha channel, and no other colours.
 
ARGB_4444: 4 bits per color channel includes alpha,

ARGB_8888: 8 bits per color channel includes alpha,
 
RGB_565  : 5 bits for Red,6 bits for Green,5 bits for Blue 

Comments

Popular posts from this blog

What is Android ?