If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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

Native Development

Reply
abx
Contributor
abx
Posts: 26
Registered: ‎10-03-2012
My Device: Playbook
My Carrier: lebara
Accepted Solution

Using img_load_file() to load a png

I'm trying to load a png file in my app to later screen_blit it to a window.  I have a couple of questions:

 

1. How do I find the full path to a file in my package? 

 

2. Can I use img_load_file to decompress a png into RGBA8888 uncompressed bitmap suitable for blitting.   Does anyone have a code snippet I can peruse?

 

Many thanks in advance.

Please use plain text.
Contributor
NareshPalle
Posts: 27
Registered: ‎04-20-2012
My Device: non-BlackBerry user
My Carrier: My company

Re: Using img_load_file() to load a png

hi,

try the following steps to load the image file in your application.

first, add your image file in bar-descriptor.xml file in assets tag

and give the file path as "app/native/imagefilename". I hope this will work for you.

Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Using img_load_file() to load a png

Please use plain text.
abx
Contributor
abx
Posts: 26
Registered: ‎10-03-2012
My Device: Playbook
My Carrier: lebara

Re: Using img_load_file() to load a png

Thank you to both. I have managed to load a png for use as a button.
Please use plain text.
New Contributor
joedpre
Posts: 3
Registered: ‎02-18-2013
My Device: BlackBerry PlayBook
My Carrier: Vodafone

Re: Using img_load_file() to load a png

Hi my name is Joe, and am currently doing my 4th year project, am trying to load multiple images, resize them and position on different location on the playbook screen, so i can use the as buttons, i have tried editing the Gesture Sample but  am still not able to able to resize and position them on areas on the screen, please help me solve the problem. Thanks

Please use plain text.
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB
My Carrier: Virgin Mobile

Re: Using img_load_file() to load a png

Please use plain text.