hey hiii u can try dis.......................
b = new ImageButton(MixView.this); Bitmap bmp = BitmapFactory.decodeResource(this.getResources(),R.drawable.mapicon1); b.setImageBitmap(bmp); On Jun 11, 1:17 am, Dixit Wadhwani <[email protected]> wrote: > --> for bitmap image..this code is not working > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > Button bt1= (Button) findViewById(R.id.idd1); > Bitmap bitmap = > BitmapFactory.decodeStream(getResources().openRawResource(R.drawable.image1)); > Bitmap Bitmap1; > Bitmap1= Bitmap.createBitmap(bitmap, 0,0 ,100,100); > bt1.setImageBitmap(Bitmap1); > > } > > } > > --> for simple image: this is working > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > Button bt1= (Button) findViewById(R.id.idd1); > bt1.setBackgroundResource(R.drawable.image1); > > } > > } > > the first one code is not working please help me out........ -- 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

