Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified
Accepted Solution

Background images for differnet resolutions

[ Edited ]

Hello,

 

Is there a way to define a single asset (background image) via styles or any other approach that will have definition for all supported screen resolutions (BB10 has 3 resolutions defined with portrait/landscape modes = 5 bitmaps)?

So, i can just use this asset without managing all the stuff in a code trying to find what resolution is now and waht orientation - and only then - get a correct image from assets.

 

There are many posts in this forum, but none seems to describing exactly the same problem.

 

Thanks,

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Background images for differnet resolutions

If you're talking about a background image of the app, you will need to manage this yourself. If you are talking about the splash screen, then you would list each splash image in the XML file.

You can resize the image to fit the stage, so you could have a rectangular and square image and then resize to fit the stage as needed. If you dont want to resize, you will then need to have an image for each device resolution and by a naming convention, you could dynamically load them based on the size of the stage (e.g. bg_720_720.jpg, etc.).

CSS might be able to help, since you can load different CSS at startup, but that would still require you to define a CSS for each variation you want to support. CSS will be more important when BB10 is available on the PlayBook since the screen density is very different.

Does this help?
Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: Background images for differnet resolutions

[ Edited ]

Thanks, it helps at least in understanding that there is no simple solution (like the one with splash screen via config file)...

I can't just resise the images, as it's a textured background. I'll have to go with dynamic load.