Image From Url

4 messages - 943 views

Hallo,,

 

How to load image from internet? I got the url and store it on DataProvider,

 

here is my xml, the @{img} is the image url

<screen shortcuts="back=askQuit|left=askQuit" focusloop="false">

<scrollPane>

<list id="category">

<_renderer>

<![CDATA[

<listItem style="bg-color:${bg-color};layout:borderlayout;gap:5 0;" onAction="nextCategory(${id})">

<picture style="layout-data:bld(west)" src="${img}"></picture>

<picture style="layout-data:bld(west)"><_image>@{img}</_image></picture>   

<container style="layout:inlinelayout(false,fill);">

<text>${name}</text>

<textarea class="small">${description}</textarea>

</container>

</listItem>

]]>

</_renderer>

<_items>@{data}</_items>

</list>

</scrollPane>

<screenfirstmenu>

%MENU%

<menupopup>

<menuItem onaction="viewcart">%VIEW_CART%</menuItem>

<menuItem onaction="goToRoot">%HOME%</menuItem>

<menuItem onaction="refreshCatalog">%REFRESH%</menuItem>

<menuItem onaction="aboutme">%ABOUT%</menuItem>

</menupopup>

</screenfirstmenu>

<screenSecondMenu onAction="backCategory">${backLabel}</screenSecondMenu>

</screen>



thanks

You can say something like this:

<picture src="${imgUrl}" style="layout-data:bld(west)"></picture>

where imgUrl is the imgUrl field of the object that you are displaying in the view.

 

nii amon

Kuix picture does not support a remote image(from internet),watch the source yourself,that's really not difficult.For Kuix does not have any socket or connection functionality.Add it yourself if you want.That's easy.

If you have an ID of picture, you can setImage for this by way:

1. Download Image from URL.

2. Get widget instance of Picture by ID

3. Set Image for widget.

 

Thanks!