10-22-2012 03:18 AM
I have a ImageButton and want to set a external image for the defaultImage.
I'm able to set the default image if I reference it from the asset folder but not externally.
// this works
// this does not. I also tried adding file:/// to the url and it doesn't work
10-22-2012 06:29 AM
Have you given permission in bar descriptor file to accsess Shared Files?
If yes then I guess it may be because the image would be too large to fit in. Max dimensions of an image which can be handled by cascade ImageView is 2048 & I assume it would be same for ImageButton.
Copy the same image to assets & try setting it from there. If it doesn't work from asstes too, you may have to use QPainter & ImageData class to replicate that image. Look at the below given link. It may help:
Do note that the PixelBufferData Class which is mentioned in above post, has been replaced by ImageData class since release of beta 3 SDK.
10-22-2012 01:00 PM - edited 10-22-2012 01:27 PM
Thanks for the reply. Shared access is ok. I can read the picture file.
No matter how I set the defaultimage for ImageButton it just won't load. When this happens the imageButton control doesn't even display on the screen. However if I change it to a Button control the picture will load fine.
I copied the same file and included in the assets folder and it works but NOT when I try to set it to a shared file path.
is the above the correct way to set the default image?
01-12-2013 06:38 AM
Did you solved this problem?
I have a similir issue. I take a pictura with the camara, and want to display it in a ImageButton. I have access to the file, because the file is sent by post to the server, and it's correct saved, but when I try
where fileName is something similar to (carama result)
the defaultImage is always black