That is great!

Thanks!

Chip
On Tue, 27 Aug 2019 01:31:33 -0700 (MST), ADeeg via 4D_Tech wrote:
> 4D Tech mailing list wrote
>> In v13, or v15 is there a way to tell is a picture in the library is in 
>> PICT, or other format?
>> 
>> Thanks
>> Chip
> 
> Chip,
> 
> this is an easy method to get the picture types without plugin calls:
> It checks for PICT, but the code is easy to modify to get the other pictre
> formats too.
> 
> C_LONGINT($i_lib;$i_byt)
> C_PICTURE($pict)
> C_TEXT($s)
> ARRAY LONGINT($aL_id;0)
> ARRAY TEXT($aT_nam;0)
> PICTURE LIBRARY LIST($aL_id;$aT_nam)
> For ($i_lib;1;Size of array($aL_id))
>       GET PICTURE FROM LIBRARY($aL_id{$i_lib};$pict)
>       SET BLOB SIZE($blob;0)
>       VARIABLE TO BLOB($pict;$blob)
>       If (BLOB size($blob)>256)
>               $s:=""
>               
>               For ($i_byt;0;256)
>                       If (($blob{$i_byt}>31) & ($blob{$i_byt}<127))
>                               $s:=$s+Char($blob{$i_byt})
>                       Else 
>                               $s:=$s+"?"
>                       End if 
>               End for 
>               
>               If (Position(".?p?i?c?t?";$s)>1) //If 
> (Position(".?p?n?g?";$s)>1) //If
> (Position(".?s?v?g?";$s)>1)
>                       GET PICTURE FROM LIBRARY($aL_id{$i_lib};$pict)
>                       CONVERT PICTURE($pict;".png")
>                       SET PICTURE TO 
> LIBRARY($pict;$aL_id{$i_lib};$aT_nam{$i_lib})
>               End if 
>       End if 
> End for 
> 
> 
> Regards Armin
> 
> 
> 
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to