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
Trusted Contributor
bbdev12345
Posts: 117
Registered: ‎09-06-2011
My Device: 9900

Re: display image from network

I have exif at the beginning of file! Thank you for that elegant code. 

 

The io_stream_t code even converts the completed_data to img_t.

 

I now just have to find a reason for 

screen_get_buffer_property_pv(bg_buf, SCREEN_PROPERTY_POINTER, (void **)img.access.direct.data); crashing with sigsev even though img.w returns the correct width.

 

Any suggestions ? if not thank you very much again for your code - it was enormously helpful.

Trusted Contributor
bbdev12345
Posts: 117
Registered: ‎09-06-2011
My Device: 9900

Re: display image from network

its actually 

screen_get_buffer_property_iv(bg_buf, SCREEN_PROPERTY_STRIDE, (int *)img.access.direct.stride);
cout << "GOTIMAGE 7" << rc; that is causing the sigsev crash, it gets past img.access.direct.data.

 

Just need to solve this last problem and I have an image from the network displayed!

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

Re: display image from network

try

screen_get_buffer_property_iv(bg_buf, SCREEN_PROPERTY_STRIDE, &img.access.direct.stride);

Trusted Contributor
bbdev12345
Posts: 117
Registered: ‎09-06-2011
My Device: 9900

Re: display image from network

yep, does the trick thanks.

 

I now have a black screen but I know the image is good because I checked file naviagtor.

 

I am using (after the last problematic line of code earlier) ..

 

img.flags |= IMG_DIRECT;
int rect[4] = { 0, 0, 1024, 600 }; // tried { 0, 0, img.w, img.h};
screen_post_window(screen, bg_buf, 1, rect, 0);

 

shows the screen but not the image.