Hi I'm creating a bitmap wich i need to use as background of a 320 width screen. The problem is that the bitmap is not getting the width i want. It is getting two empty spaces on the left and on the right. It is because it is fitting the height of the screen, but i dont want that, i want to force the bitmap to have the width i want. Doesn't matter if a portion of the height of the bitmap is out of the screen.
i need to force the width when i am adding the image to the layout, i mean that the image must be keep the aspect ratio, but the image must be higher than the height of the screen, and the image must be shown incomplete if the heigh of the image is higher than the height of the screen. Now this is not happening, because the layout is forcing the width to respect the image and show all the height of the image in the height of the screen, then i think the problem is on the layout rules im creating the bitmap with: View view; Bitmap aux = Util.loadImage( filename ); //image loaded but with his original width Bitmap image = Util.scaleBitmap(aux, 320); //scaling to 320 ((ImageView)view).setImageBitmap( resource.image ); RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams( 320 , h ); rlp.addRule( RelativeLayout.CENTER_HORIZONTAL ); rlp.addRule( RelativeLayout.ALIGN_PARENT_TOP ); layout.addView( view , rlp ); What am i doing wrong? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en