4D v13

WR INSERT PICTURE

Home

 
4D Write v13
WR INSERT PICTURE

WR INSERT PICTURE 


 

WR INSERT PICTURE ( area ; picture ; destination ; horizPos ; verticalPos ; behind ; firstPage ) 
Parameter Type   Description
area  Longint in 4D Write area
picture  Picture in Picture to insert
destination  Longint in Location of the insertion
horizPos  Longint in Horizontal position in the page
verticalPos  Longint in Vertical position in the page
behind  Integer in 0=picture above the text 1=picture in background
firstPage  Integer in ***Obsolete, do not use***

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:

Constant Type Value Comment
wr into the text flow Longint 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 current page Longint -4 The picture will be inserted on the page and visible on the current page (that containing the insertion point or the current selection).
wr on left hand pages Longint -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 right hand pages Longint -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.
Any value >0The 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:

Constant Type Value Comment
wr above text Longint 0 The picture will be inserted above the text
wr behind text Longint 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.

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

For an example of picture insertion in the page, refer to the WR SET PICTURE IN PAGE INFO command.

 
PROPERTIES 

Product: 4D
Theme: WR Picture Control
Number: 89474

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D Write 2004

 
SEE ALSO 

WR DELETE PICTURE IN PAGE