4D v13

WR SET PICTURE IN PAGE INFO

Home

 
4D Write v13
WR SET PICTURE IN PAGE INFO

WR SET PICTURE IN PAGE INFO 


 

WR SET PICTURE IN PAGE INFO ( area ; pictureNumber ; page ; behind ; firstPage ; horizPos ; verticalPos ; width ; height ) 
Parameter Type   Description
area  Longint in 4D Write area
pictureNumber  Longint in Picture number
page  Longint in Location of the picture
behind  Integer in 0=picture is above the text 1=picture is behind the text
firstPage  Integer in ***Obsolete, do not use***
horizPos  Longint in Horizontal position in page
verticalPos  Longint in Vertical position in page
width  Longint in Current picture width
height  Longint in Current picture height

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:

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.

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 GET 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)

 
PROPERTIES 

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

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D Write 2004

 
SEE ALSO 

WR GET PICTURE IN PAGE INFO