Purpose
Adds an image frame to a Layout window. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Add Image Frame [ Window window_id ]
[ Into ID frame_id ]
[ Position ( x, y ) [ Units paper_units ] ]
[ Width frame_width [ Units paper_units ] ]
[ Height frame_height [ Units paper_units ] ]
[ Angle angle ]
[ Pen .... ] [ Brush ... ] [ Priority n ] [ Name frame_name ]
From { File image_file_name }
window_id is a Layout window's integer window identifier.
frame_id is the frame identifier (ID from 1 to the total number of frames) for an empty layout frame on the current layout window.
x, y specifies the position of the upper left corner of the image frame, in paper_units, in the Layout window.
paper_units is a string representing a paper unit name: cm (centimeters), mm (millimeters), in (inches), pt (points), and pica.
- 1 inch (in) = 2.54 centimeters , 254 millimeters, 6 picas, 72 points
- 1 point (pt) = 0.01389 inches, 0.03528 centimeters, 0.35278 millimeters, 0.08333 picas
- 1pica = 0.16667 inches, 0.42333 centimeters, 4.23333 millimeters, 12 points
- 1 centimeter (cm) = 0.39370 inches, 10 millimeters, 2.36220 picas, 28.34646 points
- 1 millimeter (mm) = 0.1 centimeters, 0.03937 inches, 0.23622 picas, 2.83465 points
angle The optional Angle clause specifies the angle of the image frame in degrees; angle is a floating point number. The default angle is zero (0).
frame_width and frame_height specify the width and height of the frame in the Layout window. The Layout window maintains the aspect ratio of the image (the ratio between the height and the width), so when specifying both width and height values it applies only the last dimension and uses it to calculate the other dimension.
image_file_name is a string representing the name of the image file you are adding. Supported formats are jpg, png, bmp, gif, tif, and ico.
n is an integer value indicating the Z-Order value of objects (frames) on the Layout window. When creating a clone statement or saving a workspace, MapInfo Pro normalizes the priority of frames to a unique set of values beginning with 1.
frame_name is a string representing the name for this image frame in a layout designer. If a name is assigned to a frame in the Layout window, it will be written to the WOR. When the Name clause is written to the WOR, the workspace version is updated to version 1500.
Description
The window_id parameter specifies which window to query. To obtain a window identifier, call the FrontWindow() function immediately after opening a window, or call the WindowID() function at any time after the window's creation.
An optional Position clause lets you place the image frame within the Layout window. If it is omitted, then the image is centered in the visible area of the layout.
The optional Width and Height clauses specify the size of the image frame, in paper units. If no Width and Height clauses are provided, then the image dimensions are used. If only one value is specified, then it is used to calculate the missing value and still maintain the aspect ration of the image.
Brush is a valid Brush clause. Only Solid brushes are allowed. While values other than solid are allowed as input without error, the type is always forced to solid. This clause is used only to provide the background color for the frame.
Pen is a valid Pen clause. This clause is designed to turn on (solid) or off (hollow) and set the color of the border of the frame.
Into ID lets you insert an image into an empty layout frame. If the frame is not empty, then an error results. If the frame_id is 1 and the frame is not empty, then the message "Layout frame 1 must be empty" results.
When using the Into ID clause, other clauses are ignored and do not generate errors. These clauses are, Position, Width, and Height. The size of the frame is set to ensure the best fit of the image in it.
See Also:
Add Designer Frame statement, Add Designer Text statement, Add Image Frame statement, Add Image Page statement, FrontWindow() function, Set Paper Units statement, WindowID() function