[英]How to get a list of photos from Server and Bind it to ListBox
如何使用通配符從Server獲取和綁定照片列表,請添加到名稱中,例如Cities *。 謝謝
這個問題確實很模糊。
但是,幸運的是我手頭有一個腳本:)
這個iron7腳本允許您在flickr上搜索圖像-然后在WrapPanel中顯示返回的圖像:
http://script.iron7.com/#/Script/Detail?scriptId=Flickr&userLowerCaseName=iron7
它是Ruby,但長度不到100行,因此您應該能夠理解它-如果不是,請下載iron7並在手機上運行腳本。
重要的幾行是:
Host.call_text_web_service("flickr", "http://api.flickr.com/services/feeds/photos_public.gne?format=json&tags=" + $textbox_1.text, "web_listener")
然后添加圖像的代碼:
def process_flickr(response)
$wrap_panel.children.clear()
$big_image.visibility = Visibility.collapsed
image_urls = read_flickr_urls_from_response(response)
image_urls.each { |image_url|
image = Image.new
image.stretch = Stretch.fill
image.horizontal_alignment = HorizontalAlignment.left;
image.vertical_alignment = VerticalAlignment.top;
image.height = 160
image.width = 160
bitmap_image_source = BitmapImage.new
bitmap_image_source.uri_source = System::Uri.new(image_url)
image.source = bitmap_image_source
$wrap_panel.children.add(image)
}
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.