Herror ::set_line_approx (
    const HTuple &WindowHandle,
    const HTuple &Approximation
)
void HWindow::SetLineApprox (
    const HTuple &Approximation
) const

Define the approximation error for contour display.

::set_line_approx defines the approximation error for region contour display in the window. Approximation values greater than zero cause a polygon approximation = smoothing (with a maximum polygon/contour deviation of Approximation pixel). The approximation algorithm is the same as in ::get_region_polygon. ::set_line_approx is important for contour output via ::set_line_style.


Parameters

WindowHandle (input_control)
window -> HTuple.long
Window_id.

Approximation (input_control)
integer -> HTuple.long
Maximum deviation from the original contour.
Default value: 0
Typical range of values: 0 <= Approximation
Restriction: Approximation >= 0


Example
/* Calling */ 
set_line_approx(WindowHandle,Approximation) ;
set_draw(WindowHandle,"margin") ;
disp_region(Obj,WindowHandle) ;

/* correspond with */
Htuple Approximation,Row,Col, WindowHandleTuple ;
create_tuple(&Approximation,1) ;
set_i(Approximation,0,0) ;
create_tuple(&WindowHandleTuple,1) ;
set_i(WindowHandleTuple,WindowHandle, 0) ;
T_get_region_polygon(Obj,Approximation,&Row,&Col) ;
T_disp_polygon(WindowHandleTuple,Row,Col) ;

Result

::set_line_approx returns H_MSG_TRUE if the parameter is correct and the window is valid. Otherwise an exception handling is raised.


Possible Predecessors

::get_line_approx


Possible Successors

::disp_region


Alternatives

::get_region_polygon, ::disp_polygon


See also

::get_line_approx, ::set_line_style, ::set_draw, ::disp_region


Module

System



Copyright © 1996-2002 MVTec Software GmbH