Download zufälliges Bild von flickr mit Keyword
Frage
bemerkte ich diesen Code, wenn ich spielte herum mit Smallbasic es zu einem freind zeigt, dass es sich um eine in Option gebaut hat ein Bild von fliker zum Download basiert auf einem Schlüsselwort
Ich habe mich gefragt, ob jemand ein Beispiel in C #, dies zu tun hat, so dass ich eine Vorstellung davon bekommen, wie die api verwenden.
Lösung 2
private void button1_Click(object sender, EventArgs e)
{
string apikey = "3f8554b23a5we2fe2c7asdg80agnkdm9cedag415f34d9fb";
Flickr F = new Flickr(apikey);
// Example 2
PhotoSearchOptions searchOptions = new PhotoSearchOptions();
searchOptions.Tags = textBox1.Text;
searchOptions.PerPage = 100;
Photos microsoftPhotos = F.PhotosSearch(searchOptions);
// Example 3
searchOptions.Page = 2;
Photos microsoftPhotos2 = F.PhotosSearch(searchOptions);
searchOptions.Page = 3;
Photos microsoftPhotos3 = F.PhotosSearch(searchOptions);
// Eample 4
PhotoCollection allPhotos = microsoftPhotos.PhotoCollection;
allPhotos.AddRange(microsoftPhotos2.PhotoCollection);
allPhotos.AddRange(microsoftPhotos3.PhotoCollection);
progressBar1.Maximum = allPhotos.Count;
progressBar1.Value = 0;
foreach (Photo p in allPhotos)
{
pictureBox1.Image = Image.FromStream(F.DownloadPicture(p.MediumUrl));
this.Refresh();
progressBar1.Value++;
}
}
Andere Tipps
Ich habe noch nie mit Flickr API verwirrt, aber hier ist ein Link fand ich, dass scheint, wie es recht hilfreich wäre:
http://blogs.msdn.com/coding4fun /archive/2006/11/22/1126978.aspx
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow