Humanities Home page   Office of Digital Humanities
Back     BYU LiveCode Lessons Gateway

Exploring Image Objects

Here are two exercises to help you become familiar with image objects in LiveCode. (These do not need to be turned in.)

I. Importing Images

  1. Make a new mainstack and set it to a background color other than white.
  2. Resize it to give yourself plenty of room. Don't forget to name and save your stack if you want to save it.
  3. Import some images to your stack from an external file using File menu > Import as Control > Image File... (You can find some image files in the Resources folder on the DigHT 210 server.)
  4. Note that each imported image is contained in an image object. Image objects share many of the same properties as other objects. Try turning the image border on and off, for instance.
  5. Resize one of the imported images by dragging one of the "handles" on the edge of the image object.
  6. Pay special attention to the Quality property in the image Properties Inspector. Notice the difference in quality when you resize an image at "Normal" quality as opposed to "Best" quality.
  7. Create a new card. Now return to the first card (command (Mac) or control (Win) - 1). What happened to the resized image?
  8. An image object will always revert to its native dimensions when you close the card it is on, unless you lock the image.
    Try this:
    1. Resize the image again.
    2. Open its property inspector.
    3. Choose the Size and Position panel.
    4. Click the box labeled "Lock size and position".
    5. Confirm that the image retains the new size when you leave the card and return.

II. Images as Button Icons

  1. Create a transparent button. (Use the Style popup in the Basic panel of the property inspector.) Give the button a name and label.
  2. Choose the Icons & Border panel in the inspector.
  3. Next to the icon field, click the wand tool.
  4. Select an image from those displayed.
  5. How does the button's appearance change?
  6. Click the wand again to change the icon.
  7. Choose This Stack from the popup list at the top. This shows all the images you previously imported. Choose one. Note that any imported image can also be used as a button icon.
  8. Rename your button "Previous".
  9. Be sure you have logged in to the DigHT 210 file server. Choose File menu > Import as Control > All Images in Folder... Navigate to the Resources/images3DarrowIcons folder on the server and select the folder labeled "nextPrev-gray".
  10. Select and hide all of the arrow images you just imported. (Uncheck the "visible" checkbox in the property inspector for all the images.)
  11. Return to the Icons and Border panel for your transparent button.
  12. Assign the various icon types—Normal, Hilite, Disabled, Hover—to the appropriate button states, using the left-facing arrow set.
  13. Test the button to see the various states in action: normal icon, down or hilited icon, disabled icon, hover icon.
  14. Copy your button and name the copied button "Next".
  15. Assign the icons to the Next button, this time using the right-facing arrows.

Back     BYU LiveCode Lessons Gateway
Maintained by Devin Asay.
Copyright © 2005 Brigham Young University