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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
Developer
bba
Posts: 266
Registered: ‎04-01-2009

Add a Bitmap to the Screen

Hello,

how do I add a normal bitmap (let's say the .png icon) to my screen?

Please use plain text.
Developer
JRab
Posts: 2,462
Registered: ‎11-04-2010

Re: Add a Bitmap to the Screen

hey,

 

there are several ways to accomplish this. the easiest way is to use the QNX Image Class:

 

http://www.blackberry.com/developers/docs/airapi/1.0.0/qnx/ui/display/Image.html

 

here is an example:

 

 

    package
    {
            import flash.display.Sprite;
           
            import qnx.ui.display.Image;
           
           
            [SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
            public class ImageTest extends Sprite
            {                   
                    private var image:Image;
                   
                    public function ImageTest()
                    {
                            super();
                           
                            image = new Image();
                           
                            image.setImage("image_file.png");
                            image.setPosition(10,10);
                           
                            addChild(image);
                           
                    }
            }
    }

 

hope that helps. good luck!

 

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Please use plain text.
Contributor
redimedic
Posts: 30
Registered: ‎09-13-2011
My Carrier: Fido

Re: Add a Bitmap to the Screen

[ Edited ]

Thanks

Please use plain text.