1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Displaying Images With Shoes

By

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'
end
  1. About.com
  2. Technology
  3. Ruby
  4. Graphical User Interfaces
  5. Shoes
  6. Fetching Images from URLs

©2014 About.com. All rights reserved.