Question

I have developed an LWUIT app. I have two types of images dispayed in the app. One coming from server side that need to displayed (like a photo posted and saved to server side) and one packaged in my jar and displayed mainly as icons (like a music icon, loading animation gif etc). I need to display all images according to the sreen size and resolution. The first kind is displayed by taking the screen display height and width and then use scale method and show a scaled version of the image. But however I have no idea how to show the second kind. i.e. icons. Example, my loading image looks good in most of the phones but for some phones like samsung, it looks blurred and over-sized. How to do this. My basic idea is to keep 3 types of images of icons like icon_width_lowXheight_low.png, icon_width_mediumXheight_medium.png and image_width_highXheight_high.png and show it based on the screen size. Please let me know the bets way to achieve this? Thanks, Parvathy

Était-ce utile?

La solution

You should use MultiImages which were added in LWUIT 1.5. I don't have a link for this in LWUIT but our work in Codename One is pretty close to this so check out the How Do I? on multi images (and I suggest migration to Codename One regardless).

Autres conseils

I think that you will need to use this

Image i = Image.createImage("your image path here");

i = i.scaled(widthValue, heightValue);

And put this values in relation to the Display.getInstance().getDisplayHeight() and Display.getInstance().getDisplayWidth()

Right?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top