SlideShare une entreprise Scribd logo
1  sur  12
Microsoft® Small Basic Flickr, ImageList, and Network Objects Estimated time to complete this lesson: 1 hour
Flickr, ImageList, and Network Objects In 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 Object Let’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 Object You 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 Object 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.  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 Object This 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 Object Let’s see how you can use the various operations of the ImageList object… Let’s look at this with an example… output The 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 Object 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. The output window displays the location of the downloaded file on your computer.
The Network Object You 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: ,[object Object]

Contenu connexe

Similaire à 2.6 flickr, image list, and network objects

3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
Grails plugin development
Grails plugin developmentGrails plugin development
Grails plugin developmentMohd Farid
 
Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driverPankaj Biswas
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1H K
 
Developing an object detector solution with Azure Custom Vision .NET SDK
Developing an object detector solution with Azure Custom Vision .NET SDKDeveloping an object detector solution with Azure Custom Vision .NET SDK
Developing an object detector solution with Azure Custom Vision .NET SDKLuis Beltran
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comMohamed Rimzan
 
Chapter09 slideshow2
Chapter09 slideshow2Chapter09 slideshow2
Chapter09 slideshow2hotbyte1
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5FLYMAN TECHNOLOGY LIMITED
 
Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample Sunil kumar Mohanty
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Rashedul Islam
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...Kobkrit Viriyayudhakorn
 
The Future of the Web
The Future of the WebThe Future of the Web
The Future of the WebRay Nicholus
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQueryAlek Davis
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps QuicklyGil Irizarry
 
Desenvolva um game para android ou iPhone
Desenvolva um game para android ou iPhoneDesenvolva um game para android ou iPhone
Desenvolva um game para android ou iPhoneTiago Oliveira
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingDougal Campbell
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Gil Irizarry
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20Vivek chan
 

Similaire à 2.6 flickr, image list, and network objects (20)

Web Os Hands On
Web Os Hands OnWeb Os Hands On
Web Os Hands On
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
Grails plugin development
Grails plugin developmentGrails plugin development
Grails plugin development
 
Uploading files using selenium web driver
Uploading files using selenium web driverUploading files using selenium web driver
Uploading files using selenium web driver
 
Java script browser objects 1
Java script browser objects 1Java script browser objects 1
Java script browser objects 1
 
Developing an object detector solution with Azure Custom Vision .NET SDK
Developing an object detector solution with Azure Custom Vision .NET SDKDeveloping an object detector solution with Azure Custom Vision .NET SDK
Developing an object detector solution with Azure Custom Vision .NET SDK
 
Android intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.comAndroid intents-3 www.j2program.blogspot.com
Android intents-3 www.j2program.blogspot.com
 
Chapter09
Chapter09Chapter09
Chapter09
 
Chapter09 slideshow2
Chapter09 slideshow2Chapter09 slideshow2
Chapter09 slideshow2
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
 
Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
 
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
[React-Native Tutorial 10] Camera Roll / Gallery / Camera / Native Modules by...
 
The Future of the Web
The Future of the WebThe Future of the Web
The Future of the Web
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Make Mobile Apps Quickly
Make Mobile Apps QuicklyMake Mobile Apps Quickly
Make Mobile Apps Quickly
 
Desenvolva um game para android ou iPhone
Desenvolva um game para android ou iPhoneDesenvolva um game para android ou iPhone
Desenvolva um game para android ou iPhone
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
 
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
Make Cross-platform Mobile Apps Quickly - SIGGRAPH 2014
 
14 asp.net session20
14 asp.net session2014 asp.net session20
14 asp.net session20
 

Plus de allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced gamesallenbailey
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detectionallenbailey
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to eventsallenbailey
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapesallenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aidsallenbailey
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math objectallenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objectsallenbailey
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphicsallenbailey
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics windowallenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loopsallenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operationsallenbailey
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basicallenbailey
 

Plus de allenbailey (15)

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced games
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to events
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapes
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math object
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objects
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphics
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
 

Dernier

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Dernier (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

2.6 flickr, image list, and network objects

  • 1. Microsoft® Small Basic Flickr, ImageList, and Network Objects Estimated time to complete this lesson: 1 hour
  • 2. Flickr, ImageList, and Network Objects In 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 Object Let’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 Object You 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 Object 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. 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 Object This 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 Object Let’s see how you can use the various operations of the ImageList object… Let’s look at this with an example… output The 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 Object 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. The output window displays the location of the downloaded file on your computer.
  • 10. The Network Object You 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.
  • 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.

Notes de l'éditeur

  1. Please Note: An Internet connection is required to use the Flickr object in Small Basic.
  2. 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)
  3. 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
  4. Code:FilePath = "http://www.microsoft.com/"WebPageContent = Network.GetWebPageContents(FilePath)TextWindow.WriteLine("Page Content: ")TextWindow.WriteLine(WebPageContent)
  5. 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