2D_IMAGE_COPY

2D_IMAGE_COPY N,X1,Y1,X2,Y2

COPIES THE AREA DEFINED BY THE POINTS (X1,Y1) AND (X2,Y2) TO THE IMAGE NUMBER N

  • Type: Command
  • Parameters: 5
  • Group: Drawing

ACTION

The command 2D_IMAGE_COPY N,X1,Y1,X2,Y2 copies the rectangular area defined by the points (X1,Y1) and (X2,Y2) to the IMAGE number N. The area belongs to the "2D target" system object (set by 2D_TARGET_IS).

X1, Y1, X2, Y2 are expressed in pixels and the origin (0,0) of the coordinates is the upper left corner of the "2D target" system object.

By default, the "2D target" system object for drawing is : FORM number 0.

SYNTAX: 2D_IMAGE_COPY N,X1,Y1,X2,Y2

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.
  • X1 = X-component value (integer or real) of first point.
  • Y1 = Y-component value (integer or real) of first point.
  • X2 = X-component value (integer or real) of second point.
  • Y2 = Y-component value (integer or real) of second point.

USE

  • The command 2D_IMAGE_COPY is used to grab an area.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than or equal to 0.
  • If number N is not the number of an object IMAGE.
  • If X1 or Y1 or X2 or Y2 is not a correct expression.

EXAMPLE

rem multiply the buttons!

button 1:caption 1,"False button"

top 1,10:left 1,10

image 2

rem grab the screen

2d_image_copy 2,0,0,100,100

rem paste the screen

2d_image_paste 2,80,0

caption 1,"True button"

SEE ALSO

2D_IMAGE_PASTE

IMAGE