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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA
Accepted Solution

How to modify the Gesture sample application to load a different picture after initial load

The "Gesture" sample app is a good start for me, since I want to load and display an image full screen.

 

However, my app needs to change the image that is being displayed later on.

 

I have been successful at loading the new JPEG image via:

 

...

io_stream_t* memory_stream = io_open(IO_MEM, IO_READ, num_jpeg_bytes, jpeg_bytes);

rc = img_load(ilib, memory_stream, &callouts, &img);

...

 

... but the new image isn't displayed on the screen.  I'm assuming this is because the decode_setup function that is used to load the image on initial load doesn't work for subsequently changing the image, but I'm not sure how it needs to be changed.

 

I've read:

 

https://bdsc.webapps.blackberry.com/native/reference/com.qnx.doc.libimg.lib_ref/com.qnx.doc.libimg.l...

 

... but it doesn't seem to tell me anything more than I already know.

 

I suppose the question is this: If you load an image into an img_t structure, how do you then take that img_t and update the screen to display that image full screen?

 

Thanks!

Daniel

Retired
Posts: 1
Registered: ‎10-26-2011
My Device: Torch 9810
My Carrier: Rogers

Re: How to modify the Gesture sample application to load a different picture after initial load

Hi Daniel,

 

The decode_setup callout provided should successfully load any subsequential images into the render buffer. However this alone will not display the image on the screen. You will need to call screen_post_window() after your call to img_load to make your changes to the render buffer visible.

 

See: 

https://bdsc.webapps.blackberry.com/native/reference/com.qnx.doc.screen.lib_ref/topic/rscreen_post_w... 

for more information, or the main() function of the Gestures sample for an example.

 

Regards,

Jeff