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
Developer
Deevych
Posts: 93
Registered: ‎02-05-2011
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,

Please use plain text.
Developer
jtegen
Posts: 6,537
Registered: ‎10-27-2010
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?
Please use plain text.
Developer
Deevych
Posts: 93
Registered: ‎02-05-2011

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.

Please use plain text.