Herror ::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 HWindow::CopyRectangle (
    const HTuple &WindowHandleDestination,
    const HTuple &Row1,
    const HTuple &Column1,
    const HTuple &Row2,
    const HTuple &Column2,
    const HTuple &DestRow,
    const HTuple &DestColumn
) const

Copy all pixels within rectangles between output windows.

::copy_rectangle copies all pixels from the specified window with the logical window number WindowHandleSource in the specified window with the logical window number WindowHandleDestination. It copies pixels which reside inside a rectangle which is specified by parameters Row1, Column1, Row2 and Column2. The target position is specified through the upper left corner of the rectangle (DestRow, DestColumn).

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

You may use ::copy_rectangle 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_rectangle is much more rapid than output procedures as e.g. ::disp_channel. This means a particular advantage while using demo programs. You could even realise 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 computer.


Parameters

WindowHandleSource (input_control)
window -> HTuple.long
Number of the source window.

WindowHandleDestination (input_control)
window -> HTuple.long
Number of the destination window.

Row1 (input_control)
rectangle.origin.y(-array) -> HTuple.long
Row index of upper left corner in the source window.
Default value: 0
Typical range of values: 0 <= Row1 <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Column1 (input_control)
rectangle.origin.x(-array) -> HTuple.long
Column index of upper left corner in the source window.
Default value: 0
Typical range of values: 0 <= Column1 <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Row2 (input_control)
rectangle.corner.y(-array) -> HTuple.long
Row index of lower right corner in the source window.
Default value: 128
Typical range of values: 0 <= Row2 <= 511 (lin)
Minimum increment: 1
Recommended increment: 1
Restriction: Row2 >= Row1

Column2 (input_control)
rectangle.corner.x(-array) -> HTuple.long
Column index of lower right corner in the source window.
Default value: 128
Typical range of values: 0 <= Column2 <= 511 (lin)
Minimum increment: 1
Recommended increment: 1
Restriction: Column2 >= Column1

DestRow (input_control)
point.y(-array) -> HTuple.long
Row index of upper left corner in the target window.
Default value: 0
Typical range of values: 0 <= DestRow <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

DestColumn (input_control)
point.x(-array) -> HTuple.long
Column index of upper left corner in the target window.
Default value: 0
Typical range of values: 0 <= DestColumn <= 511 (lin)
Minimum increment: 1
Recommended increment: 1


Example
read_image(Image,"affe") ;
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) ;
clear_obj(Image) ;

Result

If the ouput window is valid and if the specified parameters are correct ::close_window returns H_MSG_TRUE. If necessary an exception handling is raised.


Possible Predecessors

::open_window, ::open_textwindow


Possible Successors

::close_window


Alternatives

::move_rectangle, ::slide_image


See also

::open_window, ::open_textwindow


Module

System



Copyright © 1996-2002 MVTec Software GmbH