Sfairadora

  • Reference Guide

Image Editor

The image editor is used to display and insert pictures (Bitmap type) into document data. The current version only allows the user to insert a picture from a file or from the clipboard. If you specify a getter function, the editor can be also used for graphical presentation of data other than pictures – the getter function creates a graphical representation of the data. The editor allows you to specify a function reacting to mouse events. Therefore you can create a specific image editor capable of editing the pictures.
The use of the image editor is explained in a separate chapter.
If you wish to insert a static picture not stored in the document data into the presentation, you should use the image label dispel.

Display

Item
Description
Frame style
Appearance of the editor frame:
none
no frame
simple
simple line (usually black; the color depends on Windows settings).
deep
three-dimensional frame that appears sunken (the standard appearance of a field for editing in Windows).
auto
the frame depends on the editor location.
Borders
The spaces left between the frame and the editor content. Values for all directions can be specified individually. If no value is specified, borders are determined automatically according to the editor location.
Background
Background color (applied to editor margins around the picture). You can choose between white and gray. However, the actual colors depend on Windows settings. If you leave the auto option in place, editors with disabled editing will be gray while the usual case will be white.
Image dimension
You can specify the image height and width in pixels. If no values are specified, the real dimensions of the image are used. However, if the image dimensions exceed the screen (application main window) size and the Do not downscale under image dimension option is not checked, the image is reduced so that all of it is visible.
The dimensions specify the optimal required image size when displayed. If the Do not downscale under image dimension/ Do not upscale above image dimension options are not checked, the user can change the displayed size by changing the window size.
Keep aspect ratio
If checked, the height and the width are modified simultaneously so that the aspect ratio is preserved. However, if both dimensions are specified, the specified values are used.
Do not downscale under image dimension
If checked, the editor size cannot be reduced under the image dimensions. The editor retains the size of the image, and a scrollbar is displayed in the window.
Do not upscale above image dimension
If checked, the editor size cannot exceed the image dimensions, even if expansion was required by alignment or if the window size was expanded manually.
Scaling options
Determines the method used to resize the image:
halftone
an average of the color values of the original pixels in the image is used (This is the default setting. Older versions of Windows may not support this function – the delete lines option is used instead.)
delete lines
superfluous lines are simply removed when downscaling and duplicated when upscaling.
merge black (AND)
for two-color images: when downsizing, and one of the original pixels is black, the resulting pixel will be black too. This option is suitable for line graphics with white background.
merge white (OR)
for two-color images: when downsizing, and one of the original pixels is white, the resulting pixel will be white too. This option is suitable for line graphics with black background.

Functionality

Item
Description
Object name
Name of the object where the edited data is located. You can select one of the objects provided by parent dispels.
Data reference
Reference to a data item within the above identified object.
The identified data must be of the Bitmap type. If it is not, you must specify a getter function that will create a Bitmap type image from the data.
Other
Getter function
This function is used to convert edited data to an image that is to be displayed in the editor. If no function is present, standard type conversion is used.
The function is specified in the Enki language – see the Bitmap and Icon Functions chapter.
Function parameters:
val
the value to be edited. Its type corresponds to the edited data item type. If data is absent, NONE value is passed.
Result type: Bitmap.
Setter function
This function is used to convert the edited image into a value that is to be saved into the edited data item. If no function is present, standard type conversion is used.
The function is specified in the Enki language.
Function parameters:
val
value of the Bitmap type – content of the image editor that should be saved.
Result: the value that will be saved into the data item. If the result type fails to match the type of the data item in which it should be stored, a type conversion is performed. If the function returns the NONE or NOT_PRESENT constant, and the edited data item is optional, its value is removed.
Mouse handling
This function allows you to modify edited data in reaction to mouse events. Any mouse event (move of the mouse pointer, click …) on the image editor calls this function. The event is described by the mouse_info parameter of the Mouse_info type. A detailed description can be found in the Mouse Handling chapter.
Definition type: Image_editor_def