Media_EffectDialog ( effectType { ; previewImage1 { ; previewImage2 } } )
Media_EffectDialog displays the effect dialog, allowing the user to choose an effect, specify its settings, and see a preview of the result in a preview thumbnail image.
Parameter | Description |
---|---|
effectType | A string that specifies the effect or effects to display. Use “” (blank) to allow the user to choose any effect. Use the four character effect type to show the parameter dialog for a specific effect (see below). |
previewImage1 | Optional image to use as the effect preview in the dialog. If omitted, a default image will be used. |
previewImage2 | Optional image to use as the effect preview in the dialog, when a two source effect is displayed. If omitted, a default image will be used. |
Once the user chooses an effect, a text string is returned that describes the selected effect and its parameters (in XML formatting). This description XML text must be passed to Media_EffectApply to apply the effect to an image. You can edit this string manually or via script, calculation, etc. to change the final effect that is applied.
Effect Type Code
If you want to specify the user’s choice of effects, you can use the four character code as the first parameter for the effect you want to allow. You can find this four character code in the returned description XML text. Us the “ostype” value within the atom tag. For example, the code for the Brightness/Contrast effect (from the description XML below) is “brco”.
If you want to give the user the full list of effect options, leave this parameter blank “” instead.
Activated by Media_EffectApply.
Returns
This function returns an XML text description of the effect selected along with the settings specified. As an example, the description response for the Brightness/Contrast effect is:
<effect>
<!-- Brightness and Contrast Effect -->
<!-- Copyright: Standard QuickTime Effect by Apple Computer, Inc. -->
<!-- Allows you to adjust the brightness and contrast of a single source. -->
<!-- This effect takes one source as input -->
<!-- This effect's major class is: Filter -->
<!-- This effect's minor class is: Adjustments -->
<atom type="what" id="1" ostype="brco" />
<!-- __Brightness__ -->
<!-- Cannot be interpolated -->
<!-- Value must be between -100 and 100 -->
<atom type="bryt" id="1" long="16" />
<!-- __Contrast__ -->
<!-- Cannot be interpolated -->
<!-- Value must be between -100 and 100 -->
<atom type="cntr" id="1" long="30" />
</effect>
If the user cancels the dialog, $xxx:Cancel is returned.
Examples
To display the effect dialog and place the resulting description text into a field named “Effect Description”:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog ( ""; ""; "" ) ]
To call the effect dialog and specify the picture in “Image Original” as the preview image used in the effect dialog:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"" ;
MyTable::Image Original
"" ) ]
To specify both “Image 1” and “Image 2” as the preview images used in effects that rely on two images:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"" ;
MyTable::Image 1
MyTable::Image 2 ) ]
To call the effect dialog with only the Brightness/Contrast effect:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"brco" ;
MyTable::Image Original
"" ) ]
To call the effect dialog and apply the selected effect to an image stored in a field named “Image Original” and place the modified image in a field named “Image Result”:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"" ;
MyTable::Image Original ;
"" ) ]
Set Field [ MyTable::Image Result ;
Media_EffectApply (
MyTable::Image Original ;
MyTable::Effect Description ) ]