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
Developer
Posts: 266
Registered: ‎04-01-2009
My Device: Not Specified

Add a Bitmap to the Screen

Hello,

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

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

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
Contributor
Posts: 30
Registered: ‎09-13-2011
My Device: Tourch
My Carrier: Fido

Re: Add a Bitmap to the Screen

[ Edited ]

Thanks