Android Question Reduction in quality

heydar ahmadi

New Member
Hello, I made a responsive app. Why does the button resolution decrease when the device dimensions are large, like in the picture?
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    22.9 KB · Views: 80

heydar ahmadi

New Member
Resolution, or size? Or are you expecting larger text?
hi
I mean the sharpness of the button’s corners. The image size is 800×1280, and in the script, I specified the button’s position using percentages.
B4X:
btnOkChannel.SetLeftAndRight(55%x,96%x)
btnOkChannel.Top=90%y
btnOkChannel.Height=9%y
 
Upvote 0

emexes

Expert
Licensed User
Longtime User
I thought the button was just a regular drawn-to-order button. If the button is an image being rescaled, and the rescaling is done using the fastest method available, eg nearest neighbour, then yes the results could be jagged. Or it could be that large displays use larger logical-to-physical pixel scaling. I don't know the solution, but with luck somebody who does will jump in.
 
Upvote 0

zed

Well-Known Member
Licensed User
The problem you're experiencing with the loss of quality and distorted rounded corners probably stems from the automatic resizing of your button image based on the screen dimensions and the percentages you're using.
If you want to preserve the quality and rounded corners, it's best to set a fixed size (in pixels or a well-calculated percentage) and position your image without stretching it excessively.
If your image is 800x1280, it's probably too large for some screens. You can resize the image to a more suitable size before using it.
The image has a Ratio of 0.625; I doubt the percentages you set will maintain this Ratio. This causes your image to be distorted.
 
Upvote 0
Top