1. Computing
Send to a Friend via Email

Displaying Images With Shoes


4 of 4

Fetching Images from URLs
Displaying Images With Shoes

You can pass the filename of an image to the image or background method, but you can also pass a URL. Shoes will automatically fetch that image from the Web, save it to a temporary file and display it. The first time you run a program with images from a URL, you'll notice a small delay when the program starts. However, starting the program again will be much faster, because any further references to the same URL will get the cached version of the image.

Shoes.app :width => 400, :height => 200 do
  image 'http://www.google.com/intl/en_ALL/images/logo.gif'

©2014 About.com. All rights reserved.