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
Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Help on loading and displaying jpg/png with NDK

I read the api/doc and the forum as much as I could and couldn't figure out how to load images and the display them on the screen properly.  Most example I found basically shows how to load and display the image to the entire screen.

 

What I wanted is to load serveral images to memory and then display them on specific location on the screen.

 

Is there such API to just draw the image to the screen buffer or I need to go thru pixmap?

 

Example would be greatly appreciated.

 

Developer
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: Help on loading and displaying jpg/png with NDK

Hi smiley,

Did you considered using Qt/QML or Cascades frameworks?
Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Help on loading and displaying jpg/png with NDK

Is this for Playbook NDK2 or for BB10?

 

Stuart

Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Help on loading and displaying jpg/png with NDK


obone wrote:
Hi smiley,

Did you considered using Qt/QML or Cascades frameworks?

 

I would use cascade but do not have the dev unit.

I can see cascade being very useful thought.

 

I looked at Qt and i don't really need all the stuff and it seems complicated.

 

All i'm looking for is some sample code on how to load images to memory and then draw them on the screen for 2.1 ndk.

 

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Help on loading and displaying jpg/png with NDK

Developer
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: Help on loading and displaying jpg/png with NDK

Keep in mind that Cascades is a QML add-on. QML is a part of Qt. I know nothing simple QML (or Cascades) for your needs. Examples are here:

http://doc-snapshot.qt-project.org/4.8/qdeclarativeexamples.html

As for Cascades, you can use simulator to develop apps:

https://developer.blackberry.com/cascades/download
Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Help on loading and displaying jpg/png with NDK

If you're on NDK2 for Playbook, Cascades is not an option. 

 

There are a number of threads discussing Qt.

Also check out some samples: https://developer.blackberry.com/native/sampleapps/

 

Stuart

Retired
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: Help on loading and displaying jpg/png with NDK

Did you make any progress?

 

Stuart

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Help on loading and displaying jpg/png with NDK

Hi,

If you want to load jpg/png image using cascade then here is a github link for that.

https://github.com/blackberry/Cascades-Samples/tree/master/cascadescookbookqml

Developer
Posts: 1,622
Registered: ‎07-14-2008
My Device: Z10
My Carrier: Fido

Re: Help on loading and displaying jpg/png with NDK

thanks but i'm using NDK beta 2.1.  I just want to load several pngs into the screen buffer and then use it later.  Is this too much to ask?