Media_EffectApply ( container1; effectDescription { ; container2 } )
Media_EffectApply adds the specified effect to an image.
Parameter | Description |
---|---|
container1 | The location of the source image.
The container parameter can be:
|
effectDescription | The XML description of the effect (returned by the Media_EffectDialog function). |
container2 | Optional second image used for effects that require two images. |
The normal sequence of events would be to first call the Media_EffectDialog function to allow the user to select an effect and its settings, and then use the returned effect description text in the Media_EffectApply function to apply the effect to an image.
Examples
To apply an effect to a picture in “Image Original” with the result appearing in a field named “Image Result” (the effect description text is already assumed to be stored in a field named “Effect Description”):
Set Field [ MyTable::Image Result ;
Media_EffectApply (
MyTable::Image Original ;
MyTable::Effect Description ) ]
To first call the effect dialog and then apply the selected effect:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"" ;
MyTable::Image Original ;
"" ) ]
Set Field [ MyTable::Image Result ;
Media_EffectApply (
MyTable::Image Original ;
MyTable::Effect Description ) ]
To show the effect dialog and then apply the selected effect for effects that rely on two images:
Set Field [ MyTable::Effect Description ;
Media_EffectDialog (
"" ;
MyTable::Image 1 ;
MyTable::Image 2 ) ]
Set Field [ MyTable::Image Result ;
Media_EffectApply (
MyTable::Image 1 ;
MyTable::Effect Description ;
MyTable::Image 2 ) ]
To apply an effect to a picture in an external image file with the result appearing in a field named “Image Result”:
Set Field [ MyTable::Image Result ;
Media_EffectApply (
".A/images/landscapes/ptreyes.jpg" ;
MyTable::Effect Description ) ]
To apply an effect to a picture in an external image file with the filepath and name stored in a text field called “Image Location”:
Set Field [ MyTable::Image Result ;
Media_EffectApply (
MyTable::Image Location ;
MyTable::Effect Description ) ]