view-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.
This 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.
Requires REBOL/View
Prepare a local copy of %bay.jpg and then
>> do %view-image.r
This script is an introduction to the view and layout functions.
Please see the REBOL/View Developer's Guide
Both REBOL/Core and REBOL/View are available
free of charge from www.rebol.com
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.
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.
You 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.
%view-image.r | Author: Unknown |
%view-image-name.r | Author: Unknown |
%view-image-name2.r | Author: Unknown |