4D Pack v13.2

AP Is Picture Deprecated

Home

 
4D Pack v13.2
AP Is Picture Deprecated

AP Is Picture Deprecated 


 

AP Is Picture Deprecated ( ptrPict ) -> Function result 
Parameter Type   Description
ptrPict  Pointer in Pointer to picture field or variable to test
Function result  Longint in 0 = valid format, 1 = obsolete format (PICT)

The AP Is Picture Deprecated command returns 1 when the picture referenced by the ptrPict parameter contains the (obsolete) PICT format and 0 otherwise. A picture is considered as obsolete when it is in the PICT format or when it contains the PICT format (pictures inserted through drag-and-drop may include several formats). 

In ptrPict, pass a pointer to a 4D picture field or variable, or to an element in a 4D picture array that you want to test. 

This command is intended to prepare the development of your applications for the next major versions of 4D. In fact, the Mac "PICT" format was declared obsolete by Apple several Mac OS versions ago (see the description of the PICT format on Wikipedia). It was kept in 4D for compatibility's sake but it is no longer supported beginning with 4D v14. To prepare for the migration of your applications, you can start using this command now so as to detect all the PICT pictures in your database and convert them to a native format (such as PNG) using the CONVERT PICTURE command. Note that once converted to a format, pictures only contain this new format.

Note: Deleting the PICT format requires prior analysis in the case of pictures intended for printing. Since PICT was a vector format, it may be used particularly under Windows for printing, when present. So in this context, it is preferable to convert PICT pictures to another vector format, such as EMF for instance.

Example  

You want to test and convert all the pictures of the library if necessary:

 PICTURE LIBRARY LIST($arrPictRef;$arrPictName)
 $vPictNums:=Size of array($arrPictRef)
 If($vPictNums>0)
    For($vPict;1;$vPictNums// for each picture
       $vPictRef:=$arrPictRef{$vPict}
       $vPictName:=$arrPictName{$vPict}
       GET PICTURE FROM LIBRARY($arrPictRef{$vPict};$pvPict)
       $vPointer :=->$vPict // passage of a pointer
       $isObs:=AP Is Picture Deprecated($vPointer)
       If($isObs=1) // if format is obsolete
          CONVERT PICTURE($vPointer->;".PNG") // conversion to png
          SET PICTURE TO LIBRARY($vPointer->;$vPictRef;$vPictName// and storage in the library
       End if
       $vPict:=$vPict+1
    End for
 Else
    ALERT("The picture library is empty.")
 End if

 
PROPERTIES 

Product: 4D Pack
Theme: 4D_Pack : Picture Files
Number: 61950

 
INDEX

Alphabetical list of commands

 
HISTORY 

New
Created: 4D Pack v13.2

 
SEE ALSO 

Definition of PICT format on Wikipedia

 
TAGS 

PICT***