Media_TQuad ( sourceScale ; topLeftX ; topLeftY ; topRightX ; topRightY ; bottomRightX ; bottomRightY ; bottomLeftX ; bottomLeftY )
Media_TQuad maps the source image into a quadrilateral of any shape when Media_TApply is called. This transformation can cause the image to appear as it would from any distance or point. Therefore Media_TQuad is often used to create a perspective projection.
Parameter | Description |
---|---|
sourceScale | The scale of the quadrilateral (in percentage). |
topLeftX | top left horizontal coordinate of the quadrilateral. |
topLeftY | top left vertical coordinate of the quadrilateral. |
topRightX | top right horizontal coordinate of the quadrilateral. |
topRightY | top right vertical coordinate of the quadrilateral. |
bottomLeftX | bottom left horizontal coordinate of the quadrilateral. |
bottomLeftY | bottom left vertical coordinate of the quadrilateral. |
bottomRightX | bottom right horizontal coordinate of the quadrilateral. |
bottomRightY | bottom right vertical coordinate of the quadrilateral. |
The scale and coordinates can be fractional. Their full precision is used in the transformation.
Once a Media_TQuad transformation has been applied to an image, it is matched to the dimensions of that image. It should only be re-applied to images of the same size. To apply the Media_TQuad transformation to images of a different size, call Media_TQuad again.
Activated by Media_TApply.
Returns
Empty string.
Examples
To create a “Star Wars” title perspective:
Set Field [ MyTable::Response ; Media_TClear ]
Set Field [ MyTable::Response;
Media_TQuad ( 100 ;
30 ; 0 ;
70 ; 0 ;
100 ; 60 ;
0 ; 60 ) ]
Set Field [ MyTable::Picture Result;
Media_TApply ( MyTable::Picture 1 ) ]
To quad an image based on the values in user-entered fields:
Set Field [ Response ; Media_TClear ]
Set Field [ MyTable::Response;
Media_TQuad ( MyTable::Scale ;
MyTable::Top Left X;
MyTable::Top Left Y;
MyTable::Top Right X;
MyTable::Top Right Y;
MyTable::Bottom Left X;
MyTable::Bottom Left Y;
MyTable::Bottom Right X;
MyTable::Bottom Right Y ) ]