Android Question Activity.SetBackgroundImage Size

alon

Active Member
Licensed User
Longtime User
Hi,

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.

2. 100%y is it dpi or px?

Thanks
 

derez

Expert
Licensed User
Longtime User
 
Upvote 0

alon

Active Member
Licensed User
Longtime User

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.

Thanks.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
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).
 
Upvote 0

alon

Active Member
Licensed User
Longtime User
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).

Thanks , 100%y/100%x is in dpi or px ?
 
Upvote 0

derez

Expert
Licensed User
Longtime User
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.
 
Upvote 0

alon

Active Member
Licensed User
Longtime User
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.

Thank you very much I will try that.
 
Upvote 0
Top