drag_region1 ( SourceRegion : DestinationRegion : WindowHandle : )

Interactive moving of a region.

drag_region1 is used to move a region on the display by mouse. Calling drag_region1 turns the region visible as soon as the left mouse button is pressed. Therefore the region's edges are displayed only. As representation mode the mode 'not' (see set_draw) is used during procedure's permanence. During the movement the cursor resides in the region's barycenter. If you move the mouse with pressed left mouse button, the depicted region follows - delayed - this movement. If you press the right mouse button you terminate drag_region1. The depicted region disappears from the display. Output is a region which corresponds to the last position on the display. You may pass even several regions at once. Procedure affine_trans_image moves the gray values.


Attention

Gray values of regions are not moved. With moving the input region it is not sure whether the gray values of the output regions are filled reasonable. This may occur if the gray values of the input regions do not comprise the whole image.


Parameters

SourceRegion (input_object)
region-array -> object
Regions to move.

DestinationRegion (output_object)
region-array -> object
Moved Regions.

WindowHandle (input_control)
window -> integer
Window_id.


Example
draw_region(Obj,WindowHandle) 
drag_region1(Obj,New,WindowHandle) 
disp_region(New,WindowHandle) 
position(Obj,_,Row1,Column1,_,_,_,_) 
position(New,_,Row2,Column2,_,_,_,_) 
disp_arrow(WindowHandle,Row1,Column1,Row2,Column2,1.0) 
fwrite_string(['Transformation: (',Row2-Row1,',',Column2-Column1,')']) 
fnew_line().

Result

drag_region1 returns 2 (H_MSG_TRUE), if a region is entered, the window is valid and the needed drawing mode (see set_insert) is available. If necessary, an exception handling is raised. You may determine the behavior after an empty input with set_system(::'no_object_result',<Result>:).


Parallelization Information

drag_region1 is reentrant, local, and processed without parallelization.


Possible Predecessors

open_window


Possible Successors

reduce_domain, disp_region, set_colored, set_line_width, set_draw, set_insert


Alternatives

get_mposition, move_region


See also

set_insert, set_draw, affine_trans_image


Module

System



Copyright © 1996-2005 MVTec Software GmbH