4D Pack v16_o_AP Is Picture Deprecated |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Pack v16
_o_AP Is Picture Deprecated
|
_o_AP Is Picture Deprecated ( ptrPict ) -> Funktionsergebnis | ||||||||
Parameter | Typ | Beschreibung | ||||||
ptrPict | Zeiger |
![]() |
Pointer to picture field or variable to test | |||||
Funktionsergebnis | Lange Ganzzahl |
![]() |
0 = valid format, 1 = obsolete format (PICT) | |||||
Starting with version 16, 4D Pack commands are obsolete and their use in 4D databases is not recommended. These commands will be removed in future versions of 4D.
The _o_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.
You want to test and convert all the pictures of the library if necessary:
C_LONGINT($vlPict;$vPictCount;$vPictRef;$vTotal)
C_TEXT($vPictName)
C_POINTER($vPointer)
C_PICTURE($vpPict)
ARRAY TEXT($arrPictNames;0)
ARRAY LONGINT($arrPictRefs;0)
$vTotal:=0
PICTURE LIBRARY LIST($arrPictRefs;$arrPictNames)
$vPictCount:=Size of array($arrPictRefs)
If($vPictCount>0)
For($vlPict;1;$vPictCount) // for each picture
$vPictRef:=$arrPictRefs{$vlPict}
$vPictName:=$arrPictNames{$vlPict}
GET PICTURE FROM LIBRARY($arrPictRefs{$vlPict};$vpPict)
$vPointer:=->$vpPict // pass a pointer
$isObs:=_o_AP Is Picture Deprecated($vPointer)
If($isObs=1) // if format is obsolete
CONVERT PICTURE($vPointer->;".PNG") // conversion to png
// and saving in library
SET PICTURE TO LIBRARY($vPointer->;$vPictRef;$vPictName)
$vTotal:=$vTotal+1
End if
End for
ALERT(String($vTotal)+" picture(s) out of "+String($vPictCount)+" were converted to png.")
Else
ALERT("The picture library is empty.")
End if
Produkt: 4D Pack
Thema: 4D_Pack : Picture Files
Nummer:
61950
Erstellt: 4D Pack v13.2
Umbenannt: 4D v16
PICT
4D Pack ( 4D Pack v16)