On Feb 10, 2018, at 2:00 PM, Dave Tenen wrote:
> Forgive my ignorance on these features. Maybe I wasn’t clear…I am in the
> toolbox, in the Pictures item. There are pictures in that list (I'm assuming
> they are buried in the structure) I want to take all of them and move them
> into a place that a different structure can use them, ideally so they can be
> reused by many structures…similar to a component!
Hi Dave,
4D provides all the commands that you need to accomplish this. I’ve not done
exactly what you want to do, but I have done something that works with the
Toolbox Picture Library.
This method converts all pictures in the library to PNG format and then writes
them back to the library. It’s an example to see the logic that you would use.
C_TEXT($pictureName_t)
C_PICTURE($picture_c)
C_LONGINT($i;$pictureID_l)
ARRAY LONGINT($pictureID_al;0)
ARRAY TEXT($pictureName_at;0)
PICTURE LIBRARY LIST($pictureID_al;$pictureName_at)
For ($i;1;Size of array($pictureID_al))
$pictureID_l:=$pictureID_al{$i}
$pictureName_t:=$pictureName_at{$i}
GET PICTURE FROM LIBRARY($pictureID_l;$picture_c)
// convert the picture
CONVERT PICTURE($picture_c;".png")
// make all white pixels transparent
TRANSFORM PICTURE($picture_c;Transparency;0x00FFFFFF)
// write back to library
SET PICTURE TO LIBRARY($picture_c;$pictureID_l;$pictureName_t)
End for
So for your need, change the SET PICTURE TO LIBRARY command to something that
will save $picture_d to file on your hard drive like the WRITE PICTURE FILE
command.
Here are the docs on “Pictures” commands. It will have all the information you
need to accomplish your goal.
http://doc.4d.com/4Dv16/4D/16.3/Pictures.201-3651053.en.html
Tim
*****************************************
Tim Nevels
Innovative Solutions
785-749-3444
[email protected]
*****************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************