Region

_AutoDetect_Copy, _AutoDetect_Cut, _Circle_Copy, _Circle_Cut, _Region_Accepted, _Region_Accepted_Binary, _Region_Copy, _Region_Cut, _Region_Paste, _Region_Settings, Region_Accepted_Binary, Region_Copy, Region_Cut, Region_Cut_RGB, Region_Info, Region_Paste, Region_Settings, Region_Settings_RGB

Region_Accepted_Binary

Interactive command to this function: Edit > Region > Accepted Region Using Binary

Description 

 Region_Accepted_Binary();

Takes the currently selected binary layer and replaces the outside of it by a background color.

Region_Copy

Interactive command to this function: Edit > Region > Copy Region

Description 

 Region_Copy(
   int  RegionXOffset,
   int  RegionYOffset
);

This function copies a polygonal region into the memory.

Parameters

int RegionXOffset

X coordinate.

int RegionYOffset

Y coordinate.

Note

If x and y parameters are valid image coordinates then the function try to select the region as a binary object on the specified position. When the x or y parameter is equal to -1 the prepared polygon (by the _Region_Copy function) is selected.

See Also 
_Region_Copy, Region_Cut, Region_Paste, _Region_Settings, Region_Info

Region_Cut

Interactive command to this function: Edit > Region > Cut Region

Description 

 Region_Cut(
   int  RegionXOffset,
   int  RegionYOffset,
   dword  RegionColor
);

This function cuts a polygonal region into the memory.

Parameters

int RegionXOffset

X coordinate.

int RegionYOffset

Y coordinate.

dword RegionColor

Fill color of the cut area.

Note

If x and y parameters are valid image coordinates then the function try to select the region as a binary object on the specified position. When the x or y parameter is equal to -1 the prepared polygon (by the _Region_Cut function) is selected. When the color parameter is equal to 0xffffffff then the cut fill color is computed automatically from the original object surrounding, otherwise the value is interpreted as a RGB value.

See Also 
Region_Cut_RGB, _Region_Cut, Region_Copy, Region_Paste

Region_Cut_RGB

Description 

 Region_Cut_RGB(
   int  RegionXOffset,
   int  RegionYOffset,
   dword  RegionColorR,
   dword  RegionColorG,
   dword  RegionColorB
);

The Region_Cut_RGB function cuts a polygonal region into the memory.

Parameters

int RegionXOffset

X coordinate.

int RegionYOffset

Y coordinate.

dword RegionColorR

Fill color - the red channel

dword RegionColorG

Fill color - the green channel

dword RegionColorB

Fill color - the blue channel

Note

If x and y parameters are valid image coordinates then the function try to select the region as a binary object on the specified position. When the x or y parameter is equal to -1 the prepared polygon (by the _Region_Cut function) is selected.

See Also 
Region_Cut, _Region_Cut, Region_Copy, Region_Paste

Region_Info

Description 

 Region_Info(
   int  info,
   byte *data,
   dword  RegionDataCount
);

The Region_Info function gives you the basic information about the region stored in the memory.

Parameters

int info

Type of info you get.

0, REGION_BOUNDING_RECT

Bounding rectangle of the object in the clipboard. Rectangle is retrieved as word values (left, top, right, bottom).

1, REGION_IMAGE_RECT

Increased bounding rectangle of the object in the clipboard. The rectangle is increased to contain all parts of the image in all possible angles of rotation. Rectangle is retrieved as word values (left, top, right, bottom).

2, REGION_CONTOUR

The coordinates of the contour of the stored region. The contour is retrieved as dword values (x, y).

3, REGION_ANGLE

Angle of stored region. The contour is retrieved as word value.

(4)

Actual bounding rectangle of the object in the clipboard. Rectangle is retrieved as word values (left, top, right, bottom).

byte *data

Array, which you must allocate, where the return values will be filled on the output.

dword RegionDataCount

Size of the array you allocated and passed to the function via the data parameter. The size should be specified in the bytes.

Note

The count parameter should specify number of bytes allocated to retrieve the info by the data parameter.

See Also 
Region_Settings, Region_Settings

Region_Paste

Interactive command to this function: Edit > Region > Paste Region

Description 

 Region_Paste(
   int  picture,
   int  RegionXOffset,
   int  RegionYOffset,
   double  angle,
   int  Method
);

This function pastes a polygonal region from the memory into the image.

Method parameter selects the paste method (0 = Paste normally, 1 = Paste with the smoothed contour, 2 = Paste normally to the point, 3 = Paste with the smoothed contour to the point).

Parameters

int picture

Destination picture

0, PICTURE_CURRENT

Current picture.

1, PICTURE_RESULT

Result picture.

2, PICTURE_REFERENCE

Reference picture.

3, PICTURE_OVERLAY

Overlay picture.

4, PIC_OFFSET

Additional pictures.

int RegionXOffset

X coordinate.

int RegionYOffset

Y coordinate.

double angle

Paste angle.

int Method

Selects a method.

Note

If x and y parameters specify the left-top corner of the increased bounding rectangle which can be retrieved by calling the Region_Info function with the REGION_IMAGE_RECT (1) constant.

See Also 
Region_Info, Region_Copy, Region_Cut, _Region_Paste

Region_Settings

Interactive command to this function: Edit > Region > Region Settings

Description 

 Region_Settings(
   int  cut_color,
   int  smooth_method
);

The Region_Settings function modifies the current cut fill color and the mode of paste operation (normal / smooth).

Parameters

int cut_color

Color of the region after Region_Cut operation. The value is 32-bit RGB coordinate. If the -1 value is specified, then the average color of the background is applied.

int smooth_method

If the value is set to 0 no smoothing will be applied, else the smoothing of the region border-pixels will be applied.

Region_Settings_RGB

Description 

 Region_Settings_RGB(
   dword  RegionColorR,
   dword  RegionColorG,
   dword  RegionColorB,
   int  PasteMethod
);

The Region_Settings_RGB function modifies the current cut fill color and the mode of paste operation (normal / smooth).

Parameters

dword RegionColorR

Fill color - the red channel

dword RegionColorG

Fill color - the green channel

dword RegionColorB

Fill color - the blue channel

int PasteMethod

If the value is set to 0 no smoothing will be applied, else the smoothing of the region border-pixels will be applied.

Note

In this function you can modify the current cut fill color and the mode of paste operation (normal / smooth).

See Also 
Region_Settings, _Region_Settings, Region_Info

_AutoDetect_Copy

This function runs the Edit > Region > Copy Auto Detect command.

Description 

 _AutoDetect_Copy();

This function performs an automatic detection of the area to copy and copies it into the application memory. After calling it, the cursor changes. Click into the intended area.

_AutoDetect_Cut

This function runs the Edit > Region > Cut Auto Detect command.

Description 

 _AutoDetect_Cut();

This function performs an automatic detection of the area to cut, cuts it out and stores the data in the application memory. After calling it, the cursor changes. Click into the intended area.

_Circle_Copy

This function runs the Edit > Region > Copy Circle command.

Description 

 _Circle_Copy();

This function switches to the circle copy mode. Draw the circle defining the center position and diameter (holding the primary mouse button). Releasing the mouse button copies the circle area and stores the data to the application memory.

_Circle_Cut

This function runs the Edit > Region > Cut Circle command.

Description 

 _Circle_Cut();

This function switches to the circle cut mode. Draw the circle defining the center position and diameter (holding the primary mouse button). Releasing the mouse button cuts the circle area and stores the data to the application memory.

_Region_Accepted

This function runs the Edit > Region > Accepted Region command.

Description 

 _Region_Accepted();

The _Region_Accepted function selects a polygonal region from the current color (gray) image.

Note

The image outside the selected region is filled with color defined by the Region_Settings function.

See Also 
_Region_Copy, _Region_Cut, _Region_Paste, _Region_Settings, Region_Info

_Region_Accepted_Binary

This function runs the Edit > Region > Accepted Region Using Binary command.

Description 

 _Region_Accepted_Binary();

Opens the Region Settings dialog window. A specific color value can be entered into the edit box - Red, Green and Blue (for RGB images) or Gray values (for gray images). Average color (average value calculated from the background pixels) can also be used to fill the binary background (Use average background).

_Region_Copy

This function runs the Edit > Region > Copy Region command.

Description 

 _Region_Copy();

This function copies a polygonal region into the memory.

Note

The image outside the selected region is filled with color defined by the Region_Settings function.

See Also 
Region_Copy, _Region_Cut, _Region_Settings, _Region_Paste, Region_Info

_Region_Cut

This function runs the Edit > Region > Cut Region command.

Description 

 _Region_Cut();

The _Region_Cut function cuts a polygonal region into the memory.

Note

The color which will be cut on the original region position is declared by the Region_Settings function.

See Also 
Region_Cut, Region_Cut_RGB, _Region_Copy, _Region_Settings, _Region_Paste, Region_Info

_Region_Paste

This function runs the Edit > Region > Paste Region command.

Description 

 _Region_Paste();

The _Region_Paste function Pastes a polygonal region from the memory into the current color (gray) image. You can interactively move and rotate the contour with the mouse.

See Also 
Region_Paste, _Region_Copy, _Region_Cut, _Region_Settings, Region_Info

_Region_Settings

This function runs the Edit > Region > Region Settings command.

Description 

 _Region_Settings();

The _Region_Settings function invokes the Region Settings dialog box.

Note

In the dialog box you can see and modify the current cut fill color and the mode of paste operation (normal / smooth).

See Also 
Region_Settings, Region_Settings_RGB, Region_Info