Starting with version 6.7, 4D has a new integrated command named READ PICTURE FILE. This command allows you to read a picture file and replaces the ACI Pack command AP_Read Picture File.
In versions 6.0 and 6.5, you would have to write the following code:
C_PICTURE($MyPicture)
`Displays an open file dialog to select the picture
$PictRef:=Open document("")
If (OK=1)
`Document system variable contains the complete path to the picture
CLOSE DOCUMENT($PictRef)
CREATE RECORD([MyTable])
$Err:=AP Read Picture File(Document;$MyPicture)
[MyTable]MyField:=$MyPicture
SAVE RECORD([MyTable])
End if
In version 6.7, the same feature is achieved by using the following code:
C_PICTURE($MyPicture)
CREATE RECORD([MyTable])
READ PICTURE FILE("";$MyPicture)
[MyTable]MyField:=$MyPicture
SAVE RECORD([MyTable])
NOTE: To avoid forcing code revisions in existing databases, the command AP_Read Picture File has been restored to the 4D Pack Plug-in in version 6.7.1. For more information see the 4D v6.7.1 Addendum.