Command WR Area to picture

4D Write

WR Area to picture

version 6.5


WR Area to picture (area{; savedDoc{; preview}}) Picture

ParameterTypeDescription
areaLongint4D Write area
savedDocInteger1 = if document is not saved, no dialog
0 = if document is not saved, the dialog is displayed
previewInteger1 = the picture is created
0 = the picture is not created

Function result Picture Picture of the contents of area

Description

The WR Area to picture command allows you to place the contents of the area referenced by area in a picture field or variable. Passing a 4D Write area to the WR Area to picture command returns a picture that can later be assigned to a picture field or a picture variable.

savedDoc

• If savedDoc equals 0, and the document has been modified since it was last saved, a dialog will be displayed asking the user if they wish to save the document.

• If savedDoc equals 1, the document will be considered as saved and the user will not be prompted to save it.

preview

• If preview equals 0, no picture preview will be created.

• If preview equals 1, a picture preview will be created.

Note: If no picture preview is created, the picture cannot be displayed.

If optional parameters are omitted, the default settings for area will be applied.

Examples

(1) You want to save Area as well as its preview picture in the Picture field "WritePictSave":

   [Texts]WritePictSave:=WR Area to picture(Area;1;1)

(2) You want to save the current text selection in a record of the [Templates] table:

   WR EXECUTE COMMAND(Area;wr cmd copy)   `Copying the selection
   CREATE RECORD([Templates])   `Creating a record in [Templates]
   Tempo:=WR New offscreen area   `Creating an offscreen area
   WR EXECUTE COMMAND(Tempo;wr cmd paste)   `Pasting selection in the area
       `Saving the result in the [Templates]Text_ field
   [Templates]Text_:=WR Area to picture(Tempo)  
   WR DELETE OFFSCREEN AREA (Tempo)   `Deleting the temporary area
   SAVE RECORD([Templates])   `Saving the record in [Templates]

See Also

WR Area to blob, WR PICTURE TO AREA.