02-08-2013 03:18 PM - edited 02-08-2013 03:20 PM
I have captured an image and now i am trying to display this image, it is proving very difficult for me to do.
I have created imageTracker and when the image is loaded i am made aware of this in onStateChange but when i try to display the loaded image it is always blank, I have changed the imageView size and it does indeed go smaller on the screen but still blank.
I know the filename I am giving to imagetracker is ok (adding file://) because if i change it to something else onStateChange code doesn't get called.
I have been at this simple task for a few hours now so somebody please help me if you can.
void App::onStateChanged(bb::cascades::ResourceState::Type state) { if(state == bb::cascades::ResourceState::Loaded) { mImage = ImageView::create(); mImage->setImage(mImageTracker->image()); mImage->setMaxWidth(500); mImage->setMaxHeight(500); Page *page = new Page(); page->setContent(mImage); mRoot->pop(); mRoot->push(page); } }
Solved! Go to Solution.
02-08-2013 03:29 PM
Try putting your image inside Container
02-08-2013 03:36 PM
Thank you for your reply.
I have tried the way I posted and also first putting the ImageView in a container and setting the container as content but neither show the image.
02-08-2013 08:41 PM
Can somebody please tell me why on earth can't I see a simple jpg I have just captured on a page in navigationPane?
I have been at this for hours and still all I get is a blank square where I should be seeing the image.
I think I understand what I should be doing (onStateChanged see above) but I get black square when I setImage().
Anyone Please?
02-09-2013 11:31 AM
bump!
02-09-2013 03:58 PM - edited 02-09-2013 11:22 PM
ImageView only handles images with dimensions less than 2048. your photo is probably larger than this.
(to clarify, it is the max size of a texture supported by the GPU if I am not mistaken)
02-09-2013 06:40 PM
This thread has sample code on resizing the image using QImage.