WR INSERT PICTURE
version 2004 (Modified)
WR INSERT PICTURE (area; picture{; destination{; horizPos{; verticalPos{; behind{; firstPage}}}}})
Parameter | Type | Description | |
area | Longint | 4D Write area | |
picture | Picture | Picture to insert | |
destination | Longint | Location of the insertion | |
horizPos | Number | Horizontal position in the page | |
verticalPos | Number | Vertical position in the page | |
behind | Integer | 0=picture above the text | |
1=picture in background | |||
firstPage | Integer | ***Obsolete, do not use*** |
Description
The WR INSERT PICTURE command inserts a picture in the 4D Write area referenced by area at the location specified by destination, horizPos and verticalPos.
picture can either be a picture field or a picture variable. If the parameter content is not a picture, error number 1065 is returned.
The destination optional parameter allows you to define where the picture will be inserted. You can use one of the following constants, found in the "WR Parameters" theme or any value >0:
Constants (value) | Description |
wr into the text flow (0) | The picture will be inserted into the text flow. In this case the |
other parameters will not be used and the picture will either be | |
inserted at the location of the insertion point or will replace the | |
current selection. | |
wr on right hand pages (-11) | The picture will be inserted into the page and will be displayed on |
right-hand pages if the even- and odd-numbered headers are | |
different, and otherwise on every page. | |
wr on left hand pages (-12) | The picture will be inserted into the page and will be displayed on |
left-hand pages onlyif the even- and odd-numbered headers are | |
different. | |
wr on current page (-4) | The picture will be inserted on the page and visible on the current |
page (that containing the insertion point or the current selection). | |
Any value >0 | The picture will be displayed on the page whose number |
is destination. The value must take into account the beginning of the | |
page numbering. |
The horizPos and verticalPos optional parameters are expressed in the current default unit for the document. These two parameters set the coordinates of the picture's upper left corner in relation to the upper left corner of the page.
The behind optional parameter allows you to define whether the picture will be behind or in front of the text. In this parameter, you can pass one of the following constants, found in the "WR Parameters" theme:
Constants (value) | Description |
wr above text (0) | The picture will be inserted above the text |
wr behind text (1) | The picture will be inserted behind the text. In this case, it is |
necessary to pay attention to the text and background attributes. | |
Selecting "None" will allow you to see the picture behind the text. |
The firstPage optional parameter is kept only for compatibility reasons and should be omitted from now on.
Examples
1. The following example is an object method attached to a button. It allows you to insert a 4D picture in the 4D Write area and to downsize it by 50%.
WR INSERT PICTURE(Area;Logo) `Inserting a picture from the Logo field
WR SELECT(Area;wr select picture;1) `Selecting the picture
WR GET PICTURE SIZE(Area;Vert;Horiz;pictPosition) `Getting the picture size
WR SET PICTURE SIZE(Area;Vert*1/2;Horiz*1/2) `Resizing the picture
2. For an example of picture insertion in the page, refer to the WR SET PICTURE IN PAGE INFO command.
See Also