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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Carrier: All
Accepted Solution

How to load an image from a URL by Cascade

[ Edited ]

I am  trying to load an image from a URL but it could not be shown. The source code is list as below:

 

ImageView {
       imageSource: "https://developer.blackberry.com/cascades/files/reference/images/image_carl_larsson_1898.png"
}

 

If Cascade doesn't support for loading image from URL, is there one regular or simple way to dynamically load image from the url by C++?

 

Thank you




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
My Carrier: none

Re: How to load an image from a URL by Cascade

This repo contains an ImageView subclass which appears to address this. The "stock" ImageView doesn't (yet) handle the http/https scheme (i.e. remote downloads).

Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Carrier: All

Re: How to load an image from a URL by Cascade

Thank you Peter. Do you have some sample codes?




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
peter9477
Posts: 5,616
Registered: ‎12-08-2010
My Carrier: none

Re: How to load an image from a URL by Cascade

I assume that repository, which is not mine, has sample code. Just check the code in src/ and assets/

Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
strobejb
Posts: 178
Registered: ‎10-15-2012
My Carrier: Orange

Re: How to load an image from a URL by Cascade

Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Carrier: All

Re: How to load an image from a URL by Cascade

Excellent! It is what I need. Thank you.




p(^_^)q
Good good study, day day up
Please use plain text.