View script | License | Download documentation as: HTML or editable | Download script | History |
[0.047] 14.04k
Documentation for: view-image.rUsage document for %view-image.r1. Introduction to %view-image.r1.1. Including %view-image-name.r and %view-image-name2.rview-image.r is an introduction to REBOL/View and image display. view-image-name.r and view-image-name2.r highlight how easily text can added to images, including over an image. 2. view-image At a GlanceThis script needs a %bay.jpg image file in the current directory. There are a few ways of getting this file, best to go to the source >> write/binary %bay.jpg read/binary http://www.rebol.com/view/bay.jpgor you can cache it... >> img: load-thru/binary http://www.rebol.org/view/bay.jpgWhich will leave a local copy for later use, in a (little) known area called the sandbox or more specifically, view-root. You can now access this image as view-root/public/www.rebol.com/view/bay.jpg Once you have the image the script is ready to run, just do it. >> do %view-image.r The above image was created running REBOL/View 2.7.5.4.2 GNU/Linux 4.0, KDE Desktop. It is a collection of three screenshots; %view-image.r, %view-image-name.r and %view-image-name2.r. 3. Using %view-image.rRequires REBOL/View 3.1. Running %view-image.rPrepare a local copy of %bay.jpg and then >> do %view-image.r 4. What you can learnThis script is an introduction to the view and layout functions. Both REBOL/Core and REBOL/View are available REBOL/View allows for very simple layouts. One point is that layout defaults to placing each element from top to bottom, or vertical direction. This functionality can easily be overridden with the layout keyword across, to place elements left to right, or horizontal direction. See the Developer's Guide for more information. The composite screenshot was produced using across. 4.1. View faces have many facets.Every face in a REBOL/View display has a number of different facets. Each face includes an image field, and also a text field. If you have both, the text shows up on top. This is shown with the %view-image-name2.r script. Because no seperate text field is created, the single face defined has both an image and text set when it is created by the layout function. VID builds the face to display both. 5. What can breakYou need to create an exact copy of the %bay.jpg binary file. Well, REBOL/Core will not have the view or layout functions defined. You will need to start up REBOL/View. 6. Credits
|