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
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon
Accepted Solution

cannot see image captured using camera

[ Edited ]

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);
    }
}

 

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

Re: cannot see image captured using camera

Try putting your image inside Container

Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: cannot see image captured using camera

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.

Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: cannot see image captured using camera

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?

Please use plain text.
Trusted Contributor
JohnWS
Posts: 117
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon

Re: cannot see image captured using camera

bump!

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 660
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: cannot see image captured using camera

[ Edited ]

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)

 

Please use plain text.
Developer
Zmey
Posts: 1,509
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: cannot see image captured using camera

http://supportforums.blackberry.com/t5/Cascades-Development/ImageView-cascades-noob-question/td-p/17...

This thread has sample code on resizing the image using QImage.

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.