I am trying to create an image as activity Background but it does not look good.
1. anyone know how can I know which size of image I need to create, in order to put it as a Background Image, in a way that the image will keep it aspect ratio and wont be stretch.
This tutorial explains the differences between the three methods. The bottom line is that the best option is to use LoadBitmapResize and set the container gravity, if possible, to Gravity.CENTER. LoadBitmap - Simply loads the bitmap as-is. Loading unknown bitmap files with LoadBitmap is...
This tutorial explains the differences between the three methods. The bottom line is that the best option is to use LoadBitmapResize and set the container gravity, if possible, to Gravity.CENTER. LoadBitmap - Simply loads the bitmap as-is. Loading unknown bitmap files with LoadBitmap is...
Thanks derez , I am already using "LoadBitmapResize"
but the image still looks stretch, so I think that the image size is wrong and I want to resize it ( with photoshop ).
and my question is how can I know what is the size that I need.
run in your code log(100%y/100%x) to get the aspect ratio, then with Photoshop crop the image to have the same ratio. With this done you can use regular loadbitmap with FILL .
You may need to change a little , depends if you use full screen and/or show form name because these use part of the activity's length (y).
run in your code log(100%y/100%x) to get the aspect ratio, then with Photoshop crop the image to have the same ratio. With this done you can use regular loadbitmap with FILL .
You may need to change a little , depends if you use full screen and/or show form name because these use part of the activity's length (y).
100%y and 100%x are the actual screen size in pixels. If you use FILL and the correct ratio you don't need to know the actual size. The image will look the same on various screen size devices if only the ratio is the same.
100%y and 100%x are the actual screen size in pixels. If you use FILL and the correct ratio you don't need to know the actual size. The image will look the same on various screen size devices if only the ratio is the same.