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
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
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: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
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 -- (BB10 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 Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
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: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
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 -- (BB10 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: 267
Registered: ‎10-15-2012
My Device: bb10 developer
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 Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
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.