0
Microsoft® Small Basic<br />Flickr, ImageList, and Network Objects<br />Estimated time to complete this lesson: 1 hour<br />
Flickr, ImageList, and Network Objects<br />In this lesson, you will learn about:<br />Using different operations of the I...
The Flickr Object<br />Let’s explore each of these operations…<br />Small Basic provides the Flickr object with two operat...
The Flickr Object<br />You can use the GetPictureOfMoment operation of the Flickr object to get the URL for Flickr’s pictu...
The Flickr Object<br />You can use the GetRandomPicture operation of the Flickr object to get the URL of a random picture,...
Continuing our discussion about images… <br />Let’s look at another object offered by Small Basic that allows you to add s...
The ImageList Object<br />Let’s see how you can use the various operations of the ImageList object…<br />Let’s look at thi...
The Network Object<br /> <br />To retrieve the required file from the network, you can use the Network object in Small Bas...
The Network Object<br />You can use the DownloadFile operation of the Network object to download a file from the network t...
The Network Object<br />You can use the GetWebPageContents operation of the Network object to get the contents of a specif...
Let’s Summarize…<br />Congratulations! Now you know how to:<br />Use different operations of the Flickr object.<br />Use d...
It’s Time to Apply Your Learning…<br />Write a program that performs the following operations:<br /><ul><li>Load 10 images...
Upcoming SlideShare
Loading in...5
×

2.6 flickr, image list, and network objects

941

Published on

Published in: Technology, Sports
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
941
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Please Note: An Internet connection is required to use the Flickr object in Small Basic.
  • Please Note: An Internet connection is required to use the Flickr object in Small Basic.Code:GraphicsWindow.BackgroundColor = &quot;Black&quot;Pic = Flickr.GetPictureOfMoment()GraphicsWindow.DrawResizedImage(Pic, 0, 0, 600, 400)
  • Please Note: An Internet connection is required to use the Flickr object in Small Basic.Code:For image = 1 to 5pic = Flickr.GetRandomPicture(&quot;landscape&quot;)Desktop.SetWallPaper(pic)Program.Delay(10000)EndFor
  • Code:FilePath = &quot;http://www.microsoft.com/&quot;WebPageContent = Network.GetWebPageContents(FilePath)TextWindow.WriteLine(&quot;Page Content: &quot;)TextWindow.WriteLine(WebPageContent)
  • Solution:While picture &lt; 10ImagePath = Flickr.GetRandomPicture(&quot;Animals&quot;) Images = ImageList.LoadImage(ImagePath) GraphicsWindow.Height = ImageList.GetHeightOfImage(Images) GraphicsWindow.Width = ImageList.GetWidthOfImage(Images) GraphicsWindow.DrawImage(Images, 0, 0) Program.Delay(2000) picture = picture + 1EndWhile
  • Transcript of "2.6 flickr, image list, and network objects"

    1. 1. Microsoft® Small Basic<br />Flickr, ImageList, and Network Objects<br />Estimated time to complete this lesson: 1 hour<br />
    2. 2. Flickr, ImageList, and Network Objects<br />In this lesson, you will learn about:<br />Using different operations of the ImageList object.<br />Using different operations of the Network object.<br />Using different operations of the Flickr object.<br />
    3. 3. The Flickr Object<br />Let’s explore each of these operations…<br />Small Basic provides the Flickr object with two operations– GetPictureOfMoment and GetRandomPicture.<br />Flickr! You can access this online image-hosting Web site right from within your Small Basic program.<br />
    4. 4. The Flickr Object<br />You can use the GetPictureOfMoment operation of the Flickr object to get the URL for Flickr’s picture of the moment.<br />You can then retrieve and display that image in your program by using the DrawImage or DrawResizedImage operations of the GraphicsWindow object.<br />
    5. 5. The Flickr Object<br />You can use the GetRandomPicture operation of the Flickr object to get the URL of a random picture, which has the same tag in Flickr as the tag you specify. <br />For example, if you want your desktop wallpaper to change to five different landscape photos, you can simply use the GetRandomPicture operation and specify the tag as “landscape” in the following manner.<br />After you run the program, you see that your desktop wallpaper changes to five different landscape images every 10000 milliseconds (10 seconds).<br />
    6. 6. Continuing our discussion about images… <br />Let’s look at another object offered by Small Basic that allows you to add specific images in your program.<br />The ImageList Object<br />This is the ImageList object.<br />You can use the ImageList object to load images from a specific location and store them in memory. The ImageList object provides the following operations:<br />LoadImage—This operation loads the stored image from a local file or the Internet into the memory of your computer. You must specify the name or the URL of the file you want to load.<br />GetHeightOfImage—This operation retrieves the height of the stored image. When using this operation, you must specify the name of the image file.<br />GetWidthOfImage—This operation retrieves the width of the stored image. When using this operation, you must specify the name of the image file.<br />
    7. 7. The ImageList Object<br />Let’s see how you can use the various operations of the ImageList object…<br />Let’s look at this with an example…<br />output<br />The height and width of the image is retrieved by using the GetHeightOfImage and GetWidthOfImage operations. <br />The GraphicsWindow is then set to the same size of the image.<br />Now, we draw the loaded image on the GraphicsWindow.<br />
    8. 8. The Network Object<br /> <br />To retrieve the required file from the network, you can use the Network object in Small Basic.<br />You may sometimes want to include a certain file in your Small Basic program. This file may be available on your local network or as a Web page on the Internet.<br />Let’s learn more about these operations and how to use them…<br />As you see, the Network object provides two operationsDownloadFile and GetWebPageContents.<br />
    9. 9. The Network Object<br />You can use the DownloadFile operation of the Network object to download a file from the network to a temporary file on your local computer. You need to specify the location of the file on the network.<br />The output window displays the location of the downloaded file on your computer.<br />
    10. 10. The Network Object<br />You can use the GetWebPageContents operation of the Network object to get the contents of a specified Web page.<br />In this case, the output window displays the HTML code of the Web page, “http: //www.microsoft.com/”.<br />output<br />
    11. 11. Let’s Summarize…<br />Congratulations! Now you know how to:<br />Use different operations of the Flickr object.<br />Use different operations of the ImageList object.<br />Use different operations of the Network object.<br />
    12. 12. It’s Time to Apply Your Learning…<br />Write a program that performs the following operations:<br /><ul><li>Load 10 images of animals from Flickr.
    13. 13. Set the height and width of the graphics window similar to that of the images.
    14. 14. Display the downloaded images in the graphics window.
    15. 15. Change the image every 2000 milliseconds.</li>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×