ClassesClasses | | Operators

copy_rectangleT_copy_rectangleCopyRectangleCopyRectangle (Operator)

Name

copy_rectangleT_copy_rectangleCopyRectangleCopyRectangle — Copy all pixels within rectangles between output windows.

Signature

copy_rectangle( : : WindowHandleSource, WindowHandleDestination, Row1, Column1, Row2, Column2, DestRow, DestColumn : )

Herror T_copy_rectangle(const Htuple WindowHandleSource, const Htuple WindowHandleDestination, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, const Htuple DestRow, const Htuple DestColumn)

void CopyRectangle(const HTuple& WindowHandleSource, const HTuple& WindowHandleDestination, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn)

void HWindow::CopyRectangle(const HWindow& WindowHandleDestination, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn) const

void HWindow::CopyRectangle(const HWindow& WindowHandleDestination, Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2, Hlong DestRow, Hlong DestColumn) const

static void HOperatorSet.CopyRectangle(HTuple windowHandleSource, HTuple windowHandleDestination, HTuple row1, HTuple column1, HTuple row2, HTuple column2, HTuple destRow, HTuple destColumn)

void HWindow.CopyRectangle(HWindow windowHandleDestination, HTuple row1, HTuple column1, HTuple row2, HTuple column2, HTuple destRow, HTuple destColumn)

void HWindow.CopyRectangle(HWindow windowHandleDestination, int row1, int column1, int row2, int column2, int destRow, int destColumn)

Description

copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectangle copies all pixels from the window WindowHandleSourceWindowHandleSourceWindowHandleSourceWindowHandleSourcewindowHandleSource in the window WindowHandleDestinationWindowHandleDestinationWindowHandleDestinationWindowHandleDestinationwindowHandleDestination. It copies pixels which reside inside a rectangle which is specified by parameters Row1Row1Row1Row1row1, Column1Column1Column1Column1column1, Row2Row2Row2Row2row2 and Column2Column2Column2Column2column2. The target position is specified through the upper left corner of the rectangle (DestRowDestRowDestRowDestRowdestRow, DestColumnDestColumnDestColumnDestColumndestColumn).

If you want to move more than one rectangle, you may pass them at once (in form of the tuple mode).

You may use copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectangle to copy edited graphics from an “invisible” window in a visible window. Therefore a window with the option 'buffer' is opened. The graphics is then displayed in this window and is copied in a visible window afterwards. The advantage of this strategy is, that copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectangle is much more rapid than output operators as, e.g., disp_channeldisp_channelDispChannelDispChannelDispChannel. This means a particular advantage while using demo programs. You could even realize short “clips”: you have to create for every image of a sequence a window of a 'buffer' type and pass the data into it. Output is the image sequence whereat all buffers are copied one after another in a visible window.

Attention

Both windows have to reside on the same display.

Execution Information

Parameters

WindowHandleSourceWindowHandleSourceWindowHandleSourceWindowHandleSourcewindowHandleSource (input_control)  window HWindow, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Source window handle.

WindowHandleDestinationWindowHandleDestinationWindowHandleDestinationWindowHandleDestinationwindowHandleDestination (input_control)  window HWindow, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Destination window handle.

Row1Row1Row1Row1row1 (input_control)  rectangle.origin.y(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row index of upper left corner in the source window.

Default value: 0

Typical range of values: 0 ≤ Row1 Row1 Row1 Row1 row1 ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Column1Column1Column1Column1column1 (input_control)  rectangle.origin.x(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column index of upper left corner in the source window.

Default value: 0

Typical range of values: 0 ≤ Column1 Column1 Column1 Column1 column1 ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Row2Row2Row2Row2row2 (input_control)  rectangle.corner.y(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row index of lower right corner in the source window.

Default value: 128

Typical range of values: 0 ≤ Row2 Row2 Row2 Row2 row2 ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Restriction: Row2 >= Row1

Column2Column2Column2Column2column2 (input_control)  rectangle.corner.x(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column index of lower right corner in the source window.

Default value: 128

Typical range of values: 0 ≤ Column2 Column2 Column2 Column2 column2 ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Restriction: Column2 >= Column1

DestRowDestRowDestRowDestRowdestRow (input_control)  point.y(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row index of upper left corner in the target window.

Default value: 0

Typical range of values: 0 ≤ DestRow DestRow DestRow DestRow destRow ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

DestColumnDestColumnDestColumnDestColumndestColumn (input_control)  point.x(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column index of upper left corner in the target window.

Default value: 0

Typical range of values: 0 ≤ DestColumn DestColumn DestColumn DestColumn destColumn ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

Example (HDevelop)

read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
               Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)

Example (C)

read_image(Image,"monkey") ;
open_window(0,0,-1,-1,"root","buffer","",&WindowHandle) ;
disp_image(Image,WindowHandle) ;
open_window(0,0,-1,-1,"root","visible","",&WindowHandleDestination) ;
do {
  get_mbutton(WindowHandleDestination,&Row,&Column,&Button) ;
  copy_rectangle(BufferID,WindowHandleDestination,90,120,390,Row,Column) ;
}
while(Button > 1) ;
close_window(WindowHandleDestination) ;
close_window(WindowHandle) ;

Example (HDevelop)

read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
               Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)

Example (HDevelop)

read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
               Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)

Example (HDevelop)

read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
               Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)

Result

If the output window is valid and if the specified parameters are correct close_windowclose_windowCloseWindowCloseWindowCloseWindow returns 2 (H_MSG_TRUE). If necessary an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowOpenWindow

Possible Successors

close_windowclose_windowCloseWindowCloseWindowCloseWindow

Alternatives

move_rectanglemove_rectangleMoveRectangleMoveRectangleMoveRectangle, slide_imageslide_imageSlideImageSlideImageSlideImage

See also

open_windowopen_windowOpenWindowOpenWindowOpenWindow

Module

Foundation


ClassesClasses | | Operators