Media_InsertImage ( filepath ; byReference )
Inserts an image into a FileMaker container field. The image can be stored directly in the container field itself or stored by reference.
Parameter | Description |
---|---|
filepath | a full file path, or partial file path that picks up with the default path. If the source is a reference, then the destination can be a path to a folder; otherwise, it must be a path to a file. The filepath parameter can be:
|
byReference | “1” or “True” to store by reference; “0” or “False” to store in container field |
Inserting Web Images
MediaManager can easily grab web images. All you need to do is use the image’s URL (Web address) as the file path parameter with Media_InsertImage.
For example, if you want to insert a web image named “banner.jpg” located in the http://www.MySite.com/images/ directory, you can use a script step:
Set Field [ MyTable::Container ;
Media_InsertImage ( "http://www.mysite.com/images/banner.jpg" ; 0 ) ]
A handy technique is to create a calculated container field that automatically inserts a web image at a URL entered into a separate text field. For example, you may have a text field named URL that allows you to enter the web address of an image. A calculated container field can automatically display the image with:
Media_InsertImage (URL Image; 0)
Examples
To insert an image into a container field named Picture 1 using a hardcoded filepath:
Set Field [ MyTable::Picture 1 ;
Media_InsertImage ( "MyDrive/Pictures/logo1.jpg" ; 0 ) ]
To store an image by reference a container field named Picture Ref using a hardcoded filepath:
Set Field [ MyTable::Picture Ref ;
Media_InsertImage ( "MyDrive/Pictures/logo1.jpg" ; True ) ]
To allow the user to select an image file to be inserted by reference:
Set Field [ MyTable::FileName ;
Media_SetDefaultFolder ( ".V:Select the image to insert" ) ]
Set Field [ MyTable::Picture Ref ;
Media_InsertImage ( "MyDrive/Pictures/logo1.jpg" ; True ) ]