SlideShare a Scribd company logo
Microsoft® Small BasicFlickr, ImageList, and Network ObjectsEstimated time to complete this lesson: 1 hour
Flickr, ImageList, and Network ObjectsIn this lesson, you will learn about:Using different operations of the ImageList object.Using different operations of the Network object.Using different operations of the Flickr object.
The Flickr ObjectLet’s explore each of these operations…Small Basic provides the Flickr object with two operations–  GetPictureOfMoment and GetRandomPicture.Flickr! You can access this online image-hosting Web site right from within your Small Basic program.
The Flickr ObjectYou can use the GetPictureOfMoment operation of the Flickr object to get the URL for Flickr’s picture of the moment.You can then retrieve and display that image in your program by using the DrawImage or DrawResizedImage operations of the GraphicsWindow object.
The Flickr ObjectYou 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. 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.After you run the program, you see that your desktop wallpaper changes to five different landscape images every 10000 milliseconds (10 seconds).
Continuing our discussion about images… Let’s look at another object offered by Small Basic that allows you to add specific images in your program.The ImageList ObjectThis is the ImageList object.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: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.GetHeightOfImage—This operation retrieves the height of the stored image. When using this operation, you must specify the name of the image file.GetWidthOfImage—This operation retrieves the width of the stored image. When using this operation, you must specify the name of the image file.
The ImageList ObjectLet’s see how you can use the various operations of the ImageList object…Let’s look at this with an example…outputThe height and width of the image is retrieved by using the GetHeightOfImage and GetWidthOfImage operations. The GraphicsWindow is then set to the same size of the image.Now, we draw the loaded image on the GraphicsWindow.
The Network Object To retrieve the required file from the network, you can use the Network object in Small Basic.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.Let’s learn more about these operations and how to use them…As you see, the Network object provides two operationsDownloadFile and GetWebPageContents.
The Network ObjectYou 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.The output window displays the location of the downloaded file on your computer.
The Network ObjectYou can use the GetWebPageContents operation of the Network object to get the contents of a specified Web page.In this case, the output window displays the HTML code of the Web page, “http: //www.microsoft.com/”.output
Let’s Summarize…Congratulations! Now you know how to:Use different operations of the Flickr object.Use different operations of the ImageList object.Use different operations of the Network object.
It’s Time to Apply Your Learning…Write a program that performs the following operations:Load 10 images of animals from Flickr.

More Related Content

PPTX
2.5 clock, desktop, and dictionary objects
PPTX
3.5 the controls object
PPTX
2.3 exploring shapes
PPTX
Altima: A KBB-like Reference Pricing System
PPTX
Chap22
PPT
Digital Techniques
PPTX
1.3 variables
PPTX
1.5 branching and subroutines
2.5 clock, desktop, and dictionary objects
3.5 the controls object
2.3 exploring shapes
Altima: A KBB-like Reference Pricing System
Chap22
Digital Techniques
1.3 variables
1.5 branching and subroutines

Similar to 2.6 flickr, image list, and network objects (7)

PPTX
5.1 sharing code
PPTX
3.1 file input and output
PPTX
2.4 sound, program, and text objects
PPTX
2.1 graphics window
PDF
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
PPTX
Filehandling
PPTX
UNIT-4 TEXT and image classification.pptx
5.1 sharing code
3.1 file input and output
2.4 sound, program, and text objects
2.1 graphics window
Lotusphere 2007 AD507 Leveraging the Power of Object Oriented Programming in ...
Filehandling
UNIT-4 TEXT and image classification.pptx
Ad

More from allenbailey (12)

PPTX
4.4 advanced games
PPTX
4.3 collision detection
PPTX
4.2 responding to events
PPTX
4.1 playing with shapes
PPTX
3.6 debugging aids
PPTX
3.4 events and interactivity
PPTX
3.3 the math object
PPTX
3.2 stacks and arrays
PPTX
2.2 turtle graphics
PPTX
1.4 conditions and loops
PPTX
1.2 statements, properties, and operations
PPTX
1.1 introduction to small basic
4.4 advanced games
4.3 collision detection
4.2 responding to events
4.1 playing with shapes
3.6 debugging aids
3.4 events and interactivity
3.3 the math object
3.2 stacks and arrays
2.2 turtle graphics
1.4 conditions and loops
1.2 statements, properties, and operations
1.1 introduction to small basic
Ad

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Electronic commerce courselecture one. Pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Machine learning based COVID-19 study performance prediction
Diabetes mellitus diagnosis method based random forest with bat algorithm
Electronic commerce courselecture one. Pdf
A comparative analysis of optical character recognition models for extracting...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Assigned Numbers - 2025 - Bluetooth® Document
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
MYSQL Presentation for SQL database connectivity
sap open course for s4hana steps from ECC to s4
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction

2.6 flickr, image list, and network objects

  • 1. Microsoft® Small BasicFlickr, ImageList, and Network ObjectsEstimated time to complete this lesson: 1 hour
  • 2. Flickr, ImageList, and Network ObjectsIn this lesson, you will learn about:Using different operations of the ImageList object.Using different operations of the Network object.Using different operations of the Flickr object.
  • 3. The Flickr ObjectLet’s explore each of these operations…Small Basic provides the Flickr object with two operations– GetPictureOfMoment and GetRandomPicture.Flickr! You can access this online image-hosting Web site right from within your Small Basic program.
  • 4. The Flickr ObjectYou can use the GetPictureOfMoment operation of the Flickr object to get the URL for Flickr’s picture of the moment.You can then retrieve and display that image in your program by using the DrawImage or DrawResizedImage operations of the GraphicsWindow object.
  • 5. The Flickr ObjectYou 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. 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.After you run the program, you see that your desktop wallpaper changes to five different landscape images every 10000 milliseconds (10 seconds).
  • 6. Continuing our discussion about images… Let’s look at another object offered by Small Basic that allows you to add specific images in your program.The ImageList ObjectThis is the ImageList object.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: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.GetHeightOfImage—This operation retrieves the height of the stored image. When using this operation, you must specify the name of the image file.GetWidthOfImage—This operation retrieves the width of the stored image. When using this operation, you must specify the name of the image file.
  • 7. The ImageList ObjectLet’s see how you can use the various operations of the ImageList object…Let’s look at this with an example…outputThe height and width of the image is retrieved by using the GetHeightOfImage and GetWidthOfImage operations. The GraphicsWindow is then set to the same size of the image.Now, we draw the loaded image on the GraphicsWindow.
  • 8. The Network Object To retrieve the required file from the network, you can use the Network object in Small Basic.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.Let’s learn more about these operations and how to use them…As you see, the Network object provides two operationsDownloadFile and GetWebPageContents.
  • 9. The Network ObjectYou 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.The output window displays the location of the downloaded file on your computer.
  • 10. The Network ObjectYou can use the GetWebPageContents operation of the Network object to get the contents of a specified Web page.In this case, the output window displays the HTML code of the Web page, “http: //www.microsoft.com/”.output
  • 11. Let’s Summarize…Congratulations! Now you know how to:Use different operations of the Flickr object.Use different operations of the ImageList object.Use different operations of the Network object.
  • 12. It’s Time to Apply Your Learning…Write a program that performs the following operations:Load 10 images of animals from Flickr.
  • 13. Set the height and width of the graphics window similar to that of the images.
  • 14. Display the downloaded images in the graphics window.
  • 15. Change the image every 2000 milliseconds.

Editor's Notes

  • #4: Please Note: An Internet connection is required to use the Flickr object in Small Basic.
  • #5: Please Note: An Internet connection is required to use the Flickr object in Small Basic.Code:GraphicsWindow.BackgroundColor = "Black"Pic = Flickr.GetPictureOfMoment()GraphicsWindow.DrawResizedImage(Pic, 0, 0, 600, 400)
  • #6: Please Note: An Internet connection is required to use the Flickr object in Small Basic.Code:For image = 1 to 5pic = Flickr.GetRandomPicture("landscape")Desktop.SetWallPaper(pic)Program.Delay(10000)EndFor
  • #11: Code:FilePath = "http://www.microsoft.com/"WebPageContent = Network.GetWebPageContents(FilePath)TextWindow.WriteLine("Page Content: ")TextWindow.WriteLine(WebPageContent)
  • #13: Solution:While picture < 10ImagePath = Flickr.GetRandomPicture("Animals") 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