Picture Operators

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


An expression that uses a picture operator returns a picture. The following table shows the picture operators.

OperationSyntaxAction
Horizontal concatenationPict1 + Pict2Add Pict2 to the right of Pict1
Vertical concatenationPict1 / Pict2Add Pict2 to the bottom of Pict1
Exclusive superimpositionPict1 & Pict2Perform an XOR on Pict1 and Pict2
Inclusive superimpositionPict1 | Pict2Perform a OR on Pict1 and Pict2
Horizontal movePicture + NumberMove Picture horizontally Number pixels
Vertical movePicture / NumberMove Picture vertically Number pixels
ResizingPicture * NumberResize Picture by Number ratio
Horizontal scalingPicture *+ NumberResize Picture horizontally by Number ratio
Vertical scalingPicture */ NumberResize Picture vertically by Number ratio

The two operators & and | always return a bitmapped picture, no matter what the nature of the two source pictures. The reason is that 4th Dimension first draws the pictures into memory bitmaps, then calculates the resulting picture by performing graphical exclusive or inclusive OR on the pixels of the bitmaps.

The other picture operators return vectorial pictures if the two source pictures are vectorial. Remember, however, that pictures printed by the display format On Background are printed bitmapped.

Examples

In the following examples, all of the pictures are shown using the display format On Background.

Here is the picture circle:

Here is the picture rectangle:

In the following examples, each expression is followed by its graphical representation.

Horizontal concatenation

   circle + rectangle ` Place the rectangle to the right of the circle




   rectangle + circle ` Place the circle to the right of the rectangle




Vertical concatenation

   circle / rectangle ` Place the rectangle under the circle



   rectangle / circle ` Place the circle under the rectangle




Exclusive superimposition (XOR)

   circle & rectangle ` Exclusive OR of the two pictures




Inclusive superimposition (OR)

   circle | rectangle ` Inclusive OR of the two pictures



Horizontal move

   rectangle + 50 ` Move the rectangle 50 pixels to the right




   rectangle - 50 ` Move the rectangle 50 pixels to the left



Vertical move

   rectangle /50 ` Move the rectangle down by 50 pixels




   rectangle /-20 ` Move the rectangle up by 20 pixels



Resize

   rectangle * 1.5 ` The rectangle becomes 50% bigger





   rectangle * 0.5 ` The rectangle becomes 50% smaller



Horizontal scaling

   circle *+3 ` The circle becomes 3 times wider




   circle *+ 0.25 ` The circle's width becomes a quarter of what it was



Vertical scaling

   circle */ 2 ` The circle becomes twice as tall




   circle */ 0.25 ` The circle's height becomes a quarter of what it was




See Also

Bitwise Operators, Comparison Operators, Date Operators, Logical Operators, Numeric Operators, Operators, String Operators, Time Operators.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next