WR INSERT PICTURE

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 2004 (Modified)


WR INSERT PICTURE (area; picture{; destination{; horizPos{; verticalPos{; behind{; firstPage}}}}})

ParameterTypeDescription
areaLongint4D Write area
picturePicturePicture to insert
destinationLongintLocation of the insertion
horizPosNumberHorizontal position in the page
verticalPosNumberVertical position in the page
behindInteger0=picture above the text
1=picture in background
firstPageInteger***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.

If you want the picture to be inserted into the text flow, pass 0 in destination or omit the parameter. 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.

If you want to insert the picture into the page, use one of the following options:

- If destination is greater than 0, the picture will be displayed in the page whose number is destination. The value of destination must take into account the page numbering as it is defined in the Preferences dialog.

- If destination equals -11, the picture will be inserted into the page and will be displayed on the right-hand pages if the even- and odd-numbered headers are different; otherwise, on every page.

- If destination equals -12, the picture will be inserted into the page and will be displayed on the left-hand pages only if the even- and odd-numbered headers are different.

- If destination equals -4, the picture will be under the text and it will be visible in the page containing the insertion point.

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.

If behind equals 1, the picture will be behind the text. In this case it is necessary to pay attention to the text and paragraph background attributes. Selecting "None" will allow you to see the picture behind the text.

If behind equals 0, the picture will be in front of the text.

The firstPage optional parameter is kept only for compatibility reasons and should be omitted starting with version 2004.

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;4;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

WR DELETE PICTURE IN PAGE.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next