Pictures can be set as the background of 4D Write Pro documents and document elements (tables, paragraphs, sections, headers/footers, etc.).
Here is an example showing two different ways a picture can be used as a document's background:
Background pictures can be set either programmatically or via the context menu. For more information, see the Background section in the Using a 4D Write Pro area article.
Anchored pictures are added with an absolute position, in front of/behind text, as well as anchored to the page or specific parts of a document (i.e., header, footer, sections). Setting an absolute position for a picture is accomplished with the WP Add picture and WP SET ATTRIBUTES commands.
Anchored picture positions can be modified with the following specific attributes and/or standard actions:
All pictures have properties (attributes) such as height, width, borders, etc., that can be get or set via the 4D Write Pro language (WP GET ATTRIBUTES and WP SET ATTRIBUTES) or standard actions.
The full list of properties available for pictures is provided on the 4D Write Pro Attributes page.
The Image section contains attributes that are specific to pictures only.
You can work with picture references (picture variables, fields, expressions) or picture URLs (text representing a local or network address of the picture).
Two sets of attributes allow you to define if you want to set or get picture reference or a picture URL:
wk image, wk background image, wk list style image: to set or to get picture references. When you get a picture using one of these attributes, you receive a 4D picture, no matter how the picture was defined.
wk image url, wk background image url, wk list style image url: to set or get picture URLs. When you get a picture using one of these attributes, you receive a text. If the picture was defined through a reference (e.g. a picture variable), you get a local URI followed by the image in Base64.
Example:
$range:=WP Get selection(WPArea) //get the picture selected by user <br />$range:=WP Create picture range($range) //create a range<br />$url:="http://doc.4d.com/image/logo/poweredby4D_web.png"<br /><br />WP SET ATTRIBUTES($range;wk image;$url) //set an image reference from a URL<br /><br />//get the image<br />C_PICTURE(vPictureGet)<br />WP GET ATTRIBUTES($range;wk image;vPictureGet) //vPictureGet contains an image<br />C_TEXT(vPictureURLGet)<br />WP GET ATTRIBUTES($range;wk image url;vPictureURLGet) //vPictureURLGet=$url
Pictures can be manipulated via the mouse or the keyboard. Available actions include:
SELECT
Pictures in the Front layer can be selected by clicking on them;
Background pictures can be selected by CTRL+ clicking on it (Windows) or COMMAND+clicking on it (Mac);
Only a single picture with an absolute position can be selected: multiple selection is not possible.
MOVE
Pictures can be moved and resized using the mouse; (inline images cannot be dragged outside the document).
INSERT
If pictures with an absolute position are pasted in Draft mode, they are displayed inline at the beginning of the current keyboard selection.
CUT/PASTE/COPY
Pictures can be copied to the clipboard, or cut/pasted while selected.
Pasting a picture with an absolute position in Page mode will paste the picture in the first selected page and anchor it to that page, no matter the original page anchoring settings; pasted pictures will retain their offsets, unless it is pasted into a different mode than the original (for instance if the picture is copied in Page mode and pasted in Embedded mode, the offsets are reset to 0).
DELETE -Pictures can be deleted while selected with the: