ClassesClassesClassesClasses | | | | Operators

set_shapeset_shapeSetShapeset_shapeSetShapeSetShape (Operator)

Name

set_shapeset_shapeSetShapeset_shapeSetShapeSetShape — Define the region output shape.

Signature

set_shape( : : WindowHandle, Shape : )

Herror set_shape(const Hlong WindowHandle, const char* Shape)

Herror T_set_shape(const Htuple WindowHandle, const Htuple Shape)

Herror set_shape(const HTuple& WindowHandle, const HTuple& Shape)

void HWindow::SetShape(const HTuple& Shape) const

void SetShape(const HTuple& WindowHandle, const HTuple& Shape)

void HWindow::SetShape(const HString& Shape) const

void HWindow::SetShape(const char* Shape) const

void HOperatorSetX.SetShape(
[in] VARIANT WindowHandle, [in] VARIANT Shape)

void HWindowX.SetShape([in] BSTR Shape)

static void HOperatorSet.SetShape(HTuple windowHandle, HTuple shape)

void HWindow.SetShape(string shape)

Description

set_shapeset_shapeSetShapeset_shapeSetShapeSetShape defines the shape for region output. It is only valid for the window with the logical window number WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle. The output shape is used by disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion. The available shapes can be queried with query_shapequery_shapeQueryShapequery_shapeQueryShapeQueryShape.

Available modes:

'original':

The shape is displayed unchanged. Nevertheless modifications via parameters like set_line_width or set_line_approx can take place. This is also true for all other modes.

'outer_circle':

Each region is displayed by the smallest surrounding circle. (See smallest_circlesmallest_circleSmallestCirclesmallest_circleSmallestCircleSmallestCircle.)

'inner_circle':

Each region is displayed by the largest included circle. (See inner_circleinner_circleInnerCircleinner_circleInnerCircleInnerCircle.)

'ellipse':

Each region is displayed by an ellipse with the same moments and orientation (See elliptic_axiselliptic_axisEllipticAxiselliptic_axisEllipticAxisEllipticAxis.)

'rectangle1':

Each region is displayed by the smallest surrounding rectangle parallel to the coordinate axes. (See smallest_rectangle1smallest_rectangle1SmallestRectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1.)

'rectangle2':

Each region is displayed by the smallest surrounding rectangle. (See smallest_rectangle2smallest_rectangle2SmallestRectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2.)

'convex':

Each region is displayed by its convex hull (See convexityconvexityConvexityconvexityConvexityConvexity.)

'icon'

Each region is displayed by the icon set with set_iconset_iconSetIconset_iconSetIconSetIcon in the center of gravity.

Attention

Caution is advised for gray value output operators with output parameter settings that use region output, e.g. disp_imagedisp_imageDispImagedisp_imageDispImageDispImage with set_paint(::WindowHandle,'histogram':)set_paint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")set_paint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram")SetPaint(WindowHandle,"histogram") and set_shape(::WindowHandle,'convex':)set_shape(WindowHandle,"convex")SetShape(WindowHandle,"convex")set_shape(WindowHandle,"convex")SetShape(WindowHandle,"convex")SetShape(WindowHandle,"convex"). In that case the convex hull of the gray value histogram is displayed.

Parallelization

Parameters

WindowHandleWindowHandleWindowHandleWindowHandleWindowHandlewindowHandle (input_control)  window HWindow, HTupleHTupleHTupleHWindowX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Window_id.

ShapeShapeShapeShapeShapeshape (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Region output mode.

Default value: 'original' "original" "original" "original" "original" "original"

List of values: 'convex'"convex""convex""convex""convex""convex", 'ellipse'"ellipse""ellipse""ellipse""ellipse""ellipse", 'icon'"icon""icon""icon""icon""icon", 'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle""inner_circle", 'original'"original""original""original""original""original", 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle""outer_circle", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2""rectangle2"

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Example (C)

read_image(&Image,"fabrik");
regiongrowing(Image,&Seg,5,5,6.0,100);
set_colored(WindowHandle,12);
set_shape(WindowHandle,"rectangle2");
disp_region(Seg,WindowHandle);

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Example (HDevelop)

read_image(Image,'fabrik')
regiongrowing(Image,Seg,5,5,6,100)
set_colored(WindowHandle,12)
set_shape(WindowHandle,'rectangle2')
disp_region(Seg,WindowHandle)

Result

set_shapeset_shapeSetShapeset_shapeSetShapeSetShape returns 2 (H_MSG_TRUE) if the parameter is correct and the window is valid. Otherwise an exception is raised.

Possible Predecessors

set_iconset_iconSetIconset_iconSetIconSetIcon, query_shapequery_shapeQueryShapequery_shapeQueryShapeQueryShape, get_shapeget_shapeGetShapeget_shapeGetShapeGetShape

Possible Successors

disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion

See also

get_shapeget_shapeGetShapeget_shapeGetShapeGetShape, query_shapequery_shapeQueryShapequery_shapeQueryShapeQueryShape, disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion

Module

Foundation


ClassesClassesClassesClasses | | | | Operators