Command WR SET PICTURE IN PAGE INFO

4D Write

WR SET PICTURE IN PAGE INFO

version 2004 (Modified)


WR SET PICTURE IN PAGE INFO (area; pictureNumber; page; behind; firstPage; horizPos; verticalPos; width; height)

ParameterTypeDescription
areaLongint4D Write area
pictureNumberLongintPicture number
pageLongintLocation of the picture
behindInteger0=picture is above the text
1=picture is behind the text
firstPageInteger***Obsolete, do not use***
horizPosNumberHorizontal position in page
verticalPosNumberVertical position in page
widthNumberCurrent picture width
heightNumberCurrent picture height

Description

The WR SET PICTURE IN PAGE INFO command allows you to modify the properties of the picture whose number was passed in pictureNumber.

Warning : this command is not to be used for pictures that are inserted in the text flow.

page allows you to define what page the picture is to be displayed in. To do so, pass the page number in page. This number should take into account the page numbering as it is set in the Preferences dialog box.

• If page equals -11, the picture will be visible on the right-hand pages if the even- and odd-numbered headers are different; otherwise, it will be visible on every page.

• If page equals -12, the picture will be visible on the left-hand pages if the even- and odd-numbered headers are different.

• If page equals -4, the previous value is not modified.

behind

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 appear above the text
wr behind text (1)The picture will appear behind the text. The text will then have a
transparent background unless a background color was previously selected
for it.

firstPage

This parameter is kept only for compatibility reasons and should not be used starting with version 2004. In order not to use it, pass -1.

horizPos and verticalPos allow you to set the horizontal and vertical coordinates of the upper left corner of the picture in relation to the upper left corner of the physical page. The value for horizPos can be between 0 and the total page width. In this case, the printer margins will not be taken into account and the picture may end up located outside the printable area of the page.

Note: When pasting a picture in the User environment, the printer margins are taken into account.

width and height allow you to set the new dimensions of the picture. Values are expressed in the current default units for the document.

Note: Passing -1 in the following parameters will not modify their initial value: behind, firstPage, horizPos, verticalPos, width and height.

Example

You want to insert the same picture in the header of each of your documents:

   C_REAL($PosHoriz;$PosVert;$PictWidth;$PictHeight;$OrigWidth;$OrigHeight;$TxtMgTop;$HeadMgBottom)
   WR SET DOC PROPERTY(Area;wr view mode;0)
   $PosHoriz:=WR Get doc property (Area;wr text left margin)
   $PosVert:=WR Get doc property(Area;wr header top margin)
   ALL RECORDS([Interface])
      `Inserting the picture
   WR INSERT PICTURE(Area;[Interface]Logo;-1;$PosHoriz;$PosVert;1;0)  `Picture is stored in the Logo field
   WR SELECT PICTURE IN PAGE(Area;1)   `Selecting the picture
      `Getting picture properties
   MyPict:=WR Get selected picture(Area;$NumPict)
   WR SET PICTURE IN PAGE INFO (Area;$NumPict;$Page;$Behind;$PageOne;$PosHoriz;$PosVert;
                                       $PictWidth;$PictHeight;$OrigWidth;$OrigHeight)
      `Decreasing picture size of 50%
   $PictHeight:=$PictHeight*1/2
   $PictWidth:=$PictWidth*1/2
   WR SET PICTURE IN PAGE INFO(Area;$NumPict;$Page;$Behind;$PageOne;$PosHoriz;$PosVert;
                                       $PictWidth;$PictHeight)
      `Checking that the header "covers" the logo
   $TxtMgTop:=WR Get doc property(Area;wr text top margin)
   $HeadMgBottom:=WR Get doc property(Area;wr header bottom margin)
   WR SET DOC PROPERTY(Area;wr text top margin;$PosVert+$PictHeight+
                                       $TxtMgTop+$HeadMgBottom)
   WR SET DOC PROPERTY(Area;wr header bottom margin;$PosVert+$PictHeight)

See Also

WR GET PICTURE IN PAGE INFO.