Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Learning is a never ending thing and just one life is not enough to learn all the things you want to learn. The ocean of knowledge is very, very deep. This blog has been created for the same objective. I write on things which I come across in my daily life and feel to share it with the people across the world. The blog publish articles on SQL Server, SSIS 2005, SSIS 2008 alongwith other useful stuff which are good to know for the professional life.
Browse by Tags · View All
Google SpreadSheet API 12
YouTube API with .NET 7
PEGA Tutorials 6
PRPC Tutorials 6
Google BigQuery 6
Google Analytics API in .NET 6
Google Cloud Services 5
Core Reporting API with C# 4
Good Data API with Picasa 4
Ms-Excel function 4

Archive · View All
June 2012 17
October 2012 12
May 2012 12
August 2012 11
March 2013 10
July 2012 10
December 2011 9
January 2012 7
September 2012 6
February 2012 6

SinghVikash Blog

How to download images from Picasa web Album with Google Data API?

May 22 2012 12:00AM by Vikash Kumar Singh   

To continue our learning towards Google Data API; this post will show us how we can download images from Google Data API.

To start with, I have designed following .NET GUI interface. We have two list view and and two button control on the form. List view 1 will fetch all album details stored in our Picasa web account. After selecting a particular web album from list view 1 control`; all the images stored in that particular web album will be shown in the list view 2.

I am importing following Google Data API namespace in the form.

using Google.GData.Client;
using Google.GData.Photos;
using Google.GData.Extensions;
using Google.GData.Extensions.Location;
using Google.Picasa;
using System.IO;

We have define string variable `myAlbumID`at form level

public partial class Form4 : Form
    {
        String myAlbumID;
….Code to follow

The .NET code snippet on "Get Album List" button is following:

private void button1_Click(object sender, EventArgs e)
{
     listView1.Columns.Add("Album ID");
     listView1.Columns.Add("Album Title");
     listView1.Columns.Add("No Of Photo");
     listView1.FullRowSelect = true;

     PicasaService myPicasa = new PicasaService("Vikash-Test-Picasa");
     myPicasa.setUserCredentials("abc@gmail.com", "abcpassword");
     AlbumQuery myAlbumQuery = new AlbumQuery(PicasaQuery.CreatePicasaUri("abc"));
     PicasaFeed myPicasaFeed=myPicasa.Query(myAlbumQuery);

     foreach (PicasaEntry p in myPicasaFeed.Entries)
     {
     AlbumAccessor myAlbum = new AlbumAccessor(p);
     listView1.Items.Add((new ListViewItem(new string[] { myAlbum.Id.ToString(),myAlbum.AlbumTitle.ToString(), myAlbum.NumPhotos.ToString()})));
     }
}

The .NET code snippet on "List view 1 select index change event" is following:

private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
     myAlbumID = "";
     listView2.Clear();
     ListView.SelectedListViewItemCollection AlbumList =listView1.SelectedItems;

     foreach (ListViewItem item in AlbumList)
     {
         myAlbumID=item.SubItems[0].Text.ToString();
     }

     if (myAlbumID.Length > 0)
     {
     listView2.Columns.Add("Photo Title");
     listView2.Columns.Add("Photo Summary");
     listView2.Columns.Add("Published Date");
     listView2.Columns.Add("Last Updated");
     listView2.FullRowSelect = true;

     PicasaService myPicasa = new PicasaService("Vikash-Test-Picasa");
     myPicasa.setUserCredentials("abc@gmail.com", "abcpassword");
     PhotoQuery myPhotoQuery = new PhotoQuery(PicasaQuery.CreatePicasaUri("abc", myAlbumID));
     PicasaFeed myPicasaFeed = myPicasa.Query(myPhotoQuery);

     foreach (PicasaEntry p in myPicasaFeed.Entries)
     {
     listView2.Items.Add(new ListViewItem(new string[] { p.Title.Text, p.Summary.Text, p.Published.ToShortDateString(), p.Updated.Date.ToShortDateString() }));
     }
     }
}

The .NET code snippet on "Dowload All Images" button is following:

private void button2_Click(object sender, EventArgs e)
{
     PicasaService myPicasa = new PicasaService("Vikash-Test-Picasa");
     myPicasa.setUserCredentials("abc@gmail.com", "abcpassword");

     PhotoQuery myPhotoQuery = new PhotoQuery(PicasaQuery.CreatePicasaUri("abc", myAlbumID));
     PicasaFeed myPicasaFeed = myPicasa.Query(myPhotoQuery);

     foreach (PicasaEntry p in myPicasaFeed.Entries)
     {
     Stream mystream=myPicasa.Query(new Uri(p.Content.Src.ToString()));
     Bitmap m = new Bitmap(mystream);
     m.Save("C:\\006. Temp\\PicasaImage\\" +p.Title.Text);
     }

     System.Windows.Forms.MessageBox.Show("All Images have been downloaded");
}

After setting up the code; I run the form and click on Get Album List button. It fetches all the album details stored in my picasa web account. I clicked on album `Google is the Best`and all images stored in that album were shown in the list view 2.

The next thing I did was to click on button “Download All Images”; the code runs successfully and downloaded all the images to C:\006. Tem\PicasaImage folder in my local system. After all images were downloaded the code pop-up a messagebox stating that All Images have been downloaded.

I checked my folder C:\006. Tem\PicasaImage and all imags were successfully downloaded.

So our objective to download images from Picasa web album has been achieved. Thanks for reading till this point.

Thanks for reading till this point.


Republished from Blog by Vikash Kumar Singh [46 clicks].  Read the original version here [1 clicks].

Vikash Kumar Singh
279 · 0% · 152
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"How to download images from Picasa web Album with Google Data API?" rated 5 out of 5 by 2 readers
How to download images from Picasa web Album with Google Data API? , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]