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

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 -> integer
Number of the source window.

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

Row1 (input_control)
rectangle.origin.y(-array) -> integer
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) -> integer
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) -> integer
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) -> integer
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) -> integer
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) -> integer
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) 
repeat() 
get_mbutton(WindowHandleDestination,Row,Column,Button)  
copy_rectangle(BufferID,WindowHandleDestination,20,90,120,390,Row,Column) 
until(Button = 1) 
close_window(WindowHandleDestination) 
close_window(WindowHandle) 
clear(Image).

Result

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


Parallelization Information

copy_rectangle is reentrant, local, and processed without parallelization.


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-2005 MVTec Software GmbH