Draw

Int_DrawCircle, Int_DrawEllipse, Int_DrawLine, Int_DrawMarker, Int_DrawPoly, Int_DrawRectangle, Int_MeasureHorizLineWithCenter

Int_DrawCircle

Description 

 Int_DrawCircle(
   int  Int_CircleMode,
   dword  circleColor,
   int *lpCircleX,
   int *lpCircleY,
   int *lpCircleRadius,
   int  circleShow
);

This function draws circle in several drawing modes. After calling this function, predefined cursor appears and you can start drawing. At the end the lpCircleX, lpCircleY and lpCircleRadius parameters are filled.

Parameters

int Int_CircleMode

Specifies the circle drawing mode. Possible constants are listened below.

1, CIRCLE_HOLLOW

In this mode you can draw the hollow circle. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpCircleX, lpCircleY and lpCircleRadius are filled on output.

2, CIRCLE_FILLED

In this mode you can draw the filled circle. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpCircleX, lpCircleY and lpCircleRadius are filled on output.

3, CIRCLE_FIXEDCENTER

In this mode you can draw the hollow circle with fixed radius. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpCircleX, lpCircleY and lpCircleRadius are filled on output. The center is specified in lpCircleX and lpCircleY parameters. If one of these parameters equals -1 the current mouse coordinates are used.

4, CIRCLE_FIXEDRADIUS

In this mode you can draw the hollow circle with fixed radius. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpCircleX, lpCircleY and lpCircleRadius are filled on output. The fixed radius is specified in lpCircleRadius parameter.

5, CIRCLE_PREDRAW

In this mode you can draw the hollow circle as in CIRCLE_HOLLOW mode but immediately after calling this function circle on specified position and with specified radius appears. Parameters lpCircleXs, lpCircleYs and lpCircleRadius are filled on input and output.

dword circleColor

The color parameter specifies the color of the circle. The color is applied only when the function parameter circleColor is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

int *lpCircleX

The pointer to x coordinate of center of the circle. This parameter is filled on the output. For CIRCLE_FIXEDCENTER (3) and for CIRCLE_PREDRAW (5) is also filled on input.

int *lpCircleY

The pointer to y coordinate of center of the circle. This parameter is filled on the output. For CIRCLE_FIXEDCENTER (3) and for CIRCLE_PREDRAW (5) is also filled on input.

int *lpCircleRadius

The pointer to radius of the circle. This parameter is filled on output. For CIRCLE_FIXEDRADIUS (4) and for CIRCLE_PREDRAW (5) modes it is also filled on input.

int circleShow

Specifies whether the circle remains on the screen after the end of the function.

0

The circle disappears after the function is executed.

1

The circle remains on the screen until another image processing function is called.

2

The circle is copied to the annotation layer.

Return Values

Unused.

//Int_DrawCircle example - draw a circle in a predraw mode interactively.    
dword   keys[2], key; 
int     xs, ys;
char    buf[256];                                      
int     width, height; 
int     radius;
SetCommandText("Int_DrawCircle example. Working...");
strcpy(buf, "   application API Example - Int_DrawCircle\tPress primary mouse button to start. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
Get_Size(SIZE_PICWND, NULL, NULL, &width, &height);
while(TRUE)
   {
   key = Int_GetEvents(&keys,2);
   if(key == keys[0]) break;
   if(key == keys[1])
  {
  xs = width/2;
  ys = height/2;
  radius = 50;
  strcpy(buf, "   application API Example - Int_DrawCircle\tMove the circle, change the circle radius. If it is OK, press right button   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                    
  Int_DrawCircle(CIRCLE_PREDRAW, RGB_DEFAULT, &xs, &ys, &radius, TRUE);
  sprintf(buf, "   application API Example.\tRadius = %i pixels   ","radius");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);        
  Wait(2.0);
  strcpy(buf, "   application API Example - Int_DrawCircle\tPress primary mouse button to start. To cancel press Esc.   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                         
  }
  }
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();

Note

You specify the menu item by filling the menuid parameter (which is returned from Int_AppendMenuEx function).

See Also 
Int_DrawEllipse, Int_DrawLine, Int_DrawMarker, Int_DrawPoly, Int_DrawRectangle

Int_DrawEllipse

Description 

 Int_DrawEllipse(
   int  elMode,
   dword  elColor,
   int *lpElX,
   int *lpElY,
   int *lpElA,
   int *lpElB,
   int  lpElAngle,
   int  elShow
);

This function allows you to draw the ellipse in several drawing modes. After calling this function, a predefined cursor appears and you can start drawing. The lpElX, lpElY, lpElA, lpElB are lpElAngle parameters are filled on output.

Parameters

int elMode

Specifies the Ellipse drawing mode. Possible constants are listened below.

1, ELLIPSE_HOLLOW

In this mode you can draw the hollow ellipse. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpEllipseX, lpEllipseY and lpEllipseRadius are filled on output.

2, ELLIPSE_FILLED

In this mode you can draw the filled ellipse. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpEllipseX, lpEllipseY and lpEllipseRadius are filled on output.

3, ELLIPSE_FIXEDCENTER

In this mode you can draw the hollow ellipse with fixed radius. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpEllipseX, lpEllipseY and lpEllipseRadius are filled on output. The center is specified in lpEllipseX and lpEllipseY parameters. If one of these parameters equals -1 the current mouse coordinates are used.

ELLIPSE_FIXEDRADIUS (4)

In this mode you can draw the hollow ellipse with fixed radius. You start drawing by pressing the primary mouse button. To end drawing release the button. Parameters lpEllipseX, lpEllipseY and lpEllipseRadius are filled on output. The fixed radius is specified in lpEllipseRadius parameter.

5, ELLIPSE_PREDRAW

In this mode you can draw the hollow ellipse as in ELLIPSE_HOLLOW mode but immediately after calling this function Ellipse on specified position and with specified radius appears. Parameters lpEllipseXs, lpEllipseYs and lpEllipseRadius are filled on input and output.

dword elColor

The color parameter specifies the color of the Ellipse. The color is applied only when the function parameter EllipseColor is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

int *lpElX

The pointer to x coordinate of center of the Ellipse. This parameter is filled on the output. For Ellipse_FIXEDCENTER and for Ellipse_PREDRAW is also filled on input.

int *lpElY

The pointer to x coordinate of center of the Ellipse. This parameter is filled on the output. For Ellipse_FIXEDCENTER and for Ellipse_PREDRAW is also filled on input.

int *lpElA

Points to a half of length of the first ellipse axis. This parameter is filled on output. For ELLIPSE_FIXEDPOS (4) and ELLIPSE_PREDRAW (5) modes it is also filled on input.

int *lpElB

Points to a half of length of the second ellipse axis. This parameter is filled on output. For ELLIPSE_FIXEDPOS (4) and ELLIPSE_PREDRAW (5) modes it is also filled on input.

int lpElAngle

Pointer to angle between ellipse axis. For ELLIPSE_FIXEDPOS (4) and ELLIPSE_PREDRAW (5) modes it is also filled on input.

int elShow

Specifies whether the Ellipse remains on the screen after the end of the function.

0

The ellipse disappears after the function is executed.

1

The ellipse remains on the screen until another image processing function is called.

2

The ellipse is copied to the annotation layer.

Return Values

Unused.

//Int_DrawEllipse example - draw a Ellipse in a predraw mode interactively.    
dword   keys[2], key; 
int     xs, ys, a, b, angle;
char    buf[256];                                      
int     width, height; 
int     radius;
SetCommandText("Int_DrawEllipse example. Working...");
strcpy(buf, "   application API Example - Int_DrawEllipse.\tPress primary mouse button to start. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
Get_Size(SIZE_PICWND, NULL, NULL, &width, &height);
while(TRUE)
   {
   key = Int_GetEvents(&keys,2);
   if(key == keys[0]) break;
   if(key == keys[1])
  {
   xs = width/2;
  ys = height/2;
  a = 100;
  b = 50;
  angle = 30;
  strcpy(buf, "   application API Example - Int_DrawEllipse\tMove the ellipse, change the ellipse angle or size. If it is OK, press right button   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                    
  Int_DrawEllipse(ELLIPSE_PREDRAW, RGB_DEFAULT, &xs, &ys, &a, &b, &angle, TRUE);
  sprintf(buf, "   application API Example - Int_DrawEllipse\tCoordinates of the center x = %i, y = %i pixels   ","xs, ys");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);        
  Wait(2.0);
  strcpy(buf, "   application API Example - Int_DrawEllipse\tPress primary mouse button to start. To cancel press Esc.   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                   
  }
  }
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();

See Also 
Int_DrawCircle, Int_DrawLine, Int_DrawMarker, Int_DrawPoly, Int_DrawRectangle

Int_DrawLine

Description 

 Int_DrawLine(
   int  lineMode,
   dword  lineColor,
   int  lineXFixed,
   int  lineYFixed,
   int  lineEnds,
   int *lpLineX1,
   int *lpLineY1,
   int *lpLineX2,
   int *lpLineY2,
   int  lineShow
);

This function enables you to interactively draw the line in several drawing modes. After calling this function, predefined cursor appears and you can start drawing. LpLineX1, lpLineY1, lpLineX2, lpLineY2 parameters are filled on the output.

Parameters

int lineMode

Specifies the Ellipse drawing mode. Possible constants are listened below.

1, LINE_GENERAL

In this mode you can draw the line in all directions, simply by specifying the first and the last point of line. The parameters lpLineX1, lpLineY1, lpLineX2, lpLineY2 are filled on the output. The lineXFixed and lineYFixed parameters are not used, lineEnds specifies the length of right angled lines added to both ends of the defined line.

3, LINE_VERTICAL

In this mode you can draw the vertical line with fixed x coordinate. The lineXFixed parameter defines the fixed x coordinate of the middle of the line. If lineXFixed == -1 the current x coordinate of the mouse is used. The lineEnds parameter specifies the length of the vertical line.

2, LINE_HORIZONTAL

In this mode you can draw the horizontal line with fixed y coordinate. The lineYFixed parameter defines the fixed y coordinate of the middle of the line. If lineYFixed == -1 the current y coordinate of the mouse is used. The lineEnds parameter specifies the length of the horizontal line.

4, LINE_CROSSES

In this mode you can draw the cross within the picture window. The lpLineX1 and lpLineY1 variables are filled with the mouse position when you push the primary mouse button and begin to specify the cross position. The lpLineX2 and lpLineY2 variables are filled with the final cross position. The lineEnds, lineXFixed and lineYFixed parameters are not used.

5, LINE_FREE

In this mode you can draw simple line defining two points. You can then change the line position by pushing the primary mouse button near the line center, or you can change one of the end points by pushing the primary mouse button near the end of the line.

6, LINE_FREEPREDRAW

This mode is similar to mode LINE_FREE, but the values stored in lpLineX1, lpLineY1, lpLineX2, lpLineY2 are used for the line predraw.

7, LINE_PARALLEL

This mode is used to draw parallel line. The values stored in lpLineX1, lpLineY1, lpLineX2, lpLineY2 are used to define the reference line.

Returns offset (x, y) as a value with a +/- sign. Returned value has to be read using the GetXYFromDWord function.

dword lineColor

The color parameter specifies the color of the line. The color is applied only when the function parameter visible is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

int lineXFixed

Applied only with the LINE_HORIZONTAL (2) mode, specifies the fixed x coordinate.

int lineYFixed

Applied only with the LINE_VERTICAL (3) mode, specifies the fixed y coordinate.

int lineEnds

The parameter has different meaning for different drawing modes. See the lineMode description for details.

int *lpLineX1

Pointer to X coordinate of start point, filled on output.

int *lpLineY1

Pointer to Y coordinate of start point, filled on output.

int *lpLineX2

Pointer to X coordinate of end point, filled on output.

int *lpLineY2

Pointer to Y coordinate of end point, filled on output.

int lineShow

Specifies whether the line remains on the screen after the function is executed.

0

The line disappears after the function is executed.

1

The line remains on the screen until another image processing function is called.

2

The line is copied to the annotation layer.

Return Values

Unused.

//Int_DrawLine example - draw a general line  interactively.    
dword   keys[2], key; 
long    coor;    
int     i, x_start, y_start, x_end, y_end; 
char    buf[256];  
SetCommandText("Int_DrawLine example. Working...");
strcpy(buf, "   application API Example - Int_DrawLine.\tPress primary mouse button to start. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
while(TRUE)
 {
 key = Int_GetEvents(&keys,2);
 if(key == keys[0]) break;
 if(key == keys[1])
 {
 coor = Int_GetMousePos(NULL, NULL);   
 Int_PostMessage(VK_LBUTTON, coor);                  
 Int_DrawLine(LINE_GENERAL,RGB_DEFAULT,0,0,20, &x_start, &y_start, &x_end, &y_end, TRUE);
 }
 }                                                  
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();
Examples:
// LINE_PARALLEL example
// This macro fetches offset of user drawn parallel line
// Coordinates of reference line
dword xStart = 100;
dword yStart = 100;
dword xEnd = 200;
dword yEnd = 200;
// Offset of drawn line
dword result = 0;
int distX = 0;
int distY = 0;
result = Int_DrawLine(LINE_PARALLEL, 255, 100, 100, 0, &xStart, &yStart, &xEnd, &yEnd, 1);
// Get offset coordinates
GetXYFromDWord(result, &distX, &distY);

See Also 
Int_DrawCircle, Int_DrawEllipse, Int_DrawMarker, Int_DrawPoly, Int_DrawRectangle, GetXYFromDWord

Int_DrawMarker

Description 

 Int_DrawMarker(
   int  MarkX,
   int  MarkY,
   int  MarkOutput,
   int  MarkType,
   int  MarkSize,
   dword  MarkColor,
   int  MarkDraw
);

This function can be used for drawing or erasing the markers. You can draw the markers to the binary picture or only to the screen. There are two sizes supported. Drawing the marker to the screen you can specify the output color using the predefined constants. There are ten types of markers.

Parameters

int MarkX

X coordinate of the marker.

int MarkY

Y coordinate of the marker.

int MarkOutput

Specifies the output mode. There are two possibilities to draw the marker to the binary picture or only to the screen.

0, MARKER_TO_SCREEN

In this mode you can draw the marker to the screen in specified color (see the color parameter). The marker will not be the part of the binary or color image.

1, MARKER_TO_BINARY

In this mode you can draw the marker to the binary image. The Boolean OR function is applied for drawing.

2, MARKER_TO_OVERLAYPICTURE

In this mode you can draw the marker to overlay image.

3, MARKER_TO_TEMPORARY

In this mode you can draw the marker to the backup DC and to the screen, the overlay picture is not affected.

int MarkType

Specifies the marker pattern. You can use numbers from 1 to 10 to select them. Number outside this range will select the default marker.

int MarkSize

Specifies the marker size.

0, MARKER_SMALL

Marker will be drawn in the normal size.

1, MARKER_LARGE

Marker will be two times bigger than the smaller one.

dword MarkColor

The color parameter specifies the color of the marker. The color is applied only when the function parameter visible is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

int MarkDraw

Specifies whether the marker will be drawn or erased.

0

Marker will be erased.

1

Marker will be drawn.

Return Values

Unused.

//Int_DrawMarker example - draw markers interactively.
dword   keys[2], key;
int     xs, ys;
char    buf[256];
SetCommandText("Int_DrawMarker example. Working...");
strcpy(buf, "   application API Example - Int_DrawMarker.\tPress primary mouse button to draw a mark. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
while(TRUE)
{
  key = Int_GetEvents(&keys,2);
  if(key == keys[0]) break;
  if(key == keys[1])
  {
  Int_GetMousePos(&xs,&ys);
  Int_DrawMarker
  (xs,ys,MARKER_TO_SCREEN,1,MARKER_SMALL,RGB_BLUE,1);       
  sprintf(buf, "   application API Example - Int_DrawMarker\tCoordinates of the marker x = %i, y = %i pixels   ","xs,ys");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);        
  Wait(2.0);
  strcpy(buf, "   application API Example\tPress primary mouse button to draw a mark. To cancel press Esc.   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                       
  }
}
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();

See Also 
Int_DrawCircle, Int_DrawEllipse, Int_DrawLine, Int_DrawPoly, Int_DrawRectangle

Int_DrawPoly

Description 

 Int_DrawPoly(
   int  polyMode,
   dword  polyColor,
   dword *polyCoors,
   dword  polyMaxCoors,
   int  polyShow
);

This function enables you to draw the polyline in several drawing modes. After calling this function, a predefined cursor appears and you can start drawing. At the end the parameter coors is filled with the polyline coordinates.

Parameters

int polyMode

Specifies the polyline drawing mode.

1, POLY_HOLLOW

In this mode you can draw the hollow polygon (the first point and the last point are connected).

2, POLY_FILLED

In this mode you can draw the filled polygon (the first point and the last point are connected).

3, POLY_LINE

In this mode you can draw the polyline (the first point and the last point are not connected).

dword polyColor

The color parameter specifies the color of the polyline. The color is applied only when the function parameter polyShow is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

dword *polyCoors

Pointer to points coordinates (DWORDS) that defines the polyline. Filled on output. Call LOWORD to get the x coordinate of the polyline point and call HIWORD to get y coordinate of the point. Macro is responsible for buffer allocation. See comment for further information.

dword polyMaxCoors

Specifies the maximum number of coordinates which will be placed into the coors array. If the lpPolyCoors pointer is not valid for lpPolyCoors DWORDs, function returns FALSE (0).

int polyShow

Specifies whether the polyline remains on the screen after the end of the function.

0

The polyline disappears after the function is executed.

1

The polyline remains on the screen until another image processing function is called.

2

The polyline is copied to the annotation layer.

Return Values

Unused.

//Int_DrawPoly example - draw a poly interactively.    
dword   key, keys[2], coords[1024]; 
char    buf[256];
word    x, y;          
dword   coor; 
dword   firstPoint;
SetCommandText("Int_DrawPoly example. Working...");
strcpy(buf, "   application API Example - Int_DrawPoly.\tPress primary mouse button to start. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
while(TRUE)
{
 key = Int_GetEvents(&keys,2);
 if(key == keys[0]) break;
 if(key == keys[1])
   {
   coor = Int_GetMousePos(NULL, NULL);   
   Int_PostMessage(VK_LBUTTON, coor);  
   memset(coords, 0, 1024*4);  
   Int_DrawPoly(POLY_HOLLOW,RGB_RED,coords,1024,TRUE);
   firstPoint = coords[0];
   x = LOWORD(firstPoint);
   y = HIWORD(firstPoint);
   sprintf(buf,"   application API Example - Int_DrawPoly\tCoordinates of First Point: x = %i,  y = %i   ","x,y");
   Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
   Wait(1.5);  
   strcpy(buf, "   application API Example - Int_DrawPoly\tPress primary mouse button to start. To cancel press Esc.   ");
   Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
   }
}                                                    
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();

Note

If you fill the polyCoors with the point coordinates, the function creates the polygon at the start and lets user to edit it. Point coordinates may be filled using MAKELPARAM(x, y). The list of points is terminated with zero. Accordingly, if one of the points is the coordinates origin, you have to put this point on the top of the list (else it causes the function to terminate). Additionally, if you set polyMaxCoors exactly as the number of input points, the function will not let user to add new points on the edges.

See Also 
Int_DrawCircle, Int_DrawEllipse, Int_DrawLine, Int_DrawMarker, Int_DrawRectangle

Int_DrawRectangle

Description 

 Int_DrawRectangle(
   int  rectMode,
   dword  rectColor,
   int *lpRectX,
   int *lpRectY,
   int *lpRectWidth,
   int *lpRectHeight,
   int  rectShow
);

This function enables you to draw the rectangle in several drawing modes. After calling this function, a predefined cursor appears and you can start drawing.

Parameters

int rectMode

Specifies the polyline drawing mode.

1, RECT_HOLLOW

In this mode you can draw the hollow rectangle. You start drawing by pressing the primary mouse button. To end drawing release the button. After drawing, the variables lpRectX, lpRectY, lpRectWidth and lpRectHeight are filled.

2, RECT_FILLED

In this mode you can draw the filled rectangle. You start drawing by pressing the primary mouse button. To end drawing release the button. After drawing, the variables lpRectX, lpRectY, lpRectWidth and lpRectHeight are filled.

3, RECT_FIXEDCENTER

In this mode you can draw the hollow rectangle with the fixed center point. To specify the fixed coordinates of the center point, pass them in lpRectX and lpRectY parameters. When some of *lpRectX or *lpRectY equals -1 the current cursor coordinates are used.

4, RECT_FIXEDSIZE

In this mode you can draw the hollow rectangle with fixed width and height. You specify these values in lpRectWidth and lpRectHeight parameters.

5, RECT_ASPECT

In this mode you can draw the hollow rectangle with fixed aspect ratio. The aspect ratio is determined by the initial width and height values. If you assign the x or y coordinate the 65535 value, then the rectangle will be not predrawn.

dword rectColor

The color parameter specifies the color of the rectangle. The color is applied only when the function parameter rectShow is not zero. Use predefined color constants (RGB_BLACK (0), RGB_BLUE (16711680), RGB_CYAN (16776960), RGB_GREEN (65280), RGB_MAGENTA (16711935), RGB_RED (255), RGB_WHITE (16777215), RGB_YELLOW (65535) or RGB_DEFAULT (2147483647)) or any RGB value. See RGB function for details.

int *lpRectX

The pointer to x coordinate of first point of the rectangle. This parameter is filled on output. For RECT_FIXEDCENTER (3) mode the parameter is also filled on input and means the x coordinate of the center.

int *lpRectY

The pointer to y coordinate of first point of the rectangle. This parameter is filled on output. For RECT_FIXEDCENTER (3) mode the parameter is also filled on input and means the y coordinate of the center.

int *lpRectWidth

Pointer to the width of the rectangle. This parameter is filled on output. For RECT_FIXEDSIZE (4) the parameter is also filled on input and means the fixed width of the rectangle.

int *lpRectHeight

Pointer to the height of the rectangle. This parameter is filled on output. For RECT_FIXEDSIZE (4) the parameter is also filled on input and means the fixed height of the rectangle.

int rectShow

Specifies whether the rectangle remains on the screen after the end of the function.

0

The rectangle disappears after the function is executed.

1

The rectangle remains on the screen until another image processing function is called.

2

The rectangle is copied to the annotation layer.

//Int_DrawRectangle example - draw a rectangle interactively.    
dword   keys[2], key; 
int     x_start, y_start;
int     width, height;
int     p_width, p_height;
char    buf[256];  
long    coor;  
SetCommandText("Int_DrawRectangle example. Working...");
strcpy(buf, "   application API Example - Int_DrawRectangle.\tPress primary mouse button to star. To cancel press Esc.   ");
Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);  
keys[0] = VK_ESC;
keys[1] = VK_LBUTTON;
while(TRUE)
  {
  key = Int_GetEvents(&keys,2);
  if(key == keys[0]) break;
  if(key == keys[1])
 {
  x_start = p_width/2;      
  y_start = p_height/2;
  Int_PostMessage(VK_LBUTTON, 0);
  Int_DrawRectangle(RECT_FIXEDCENTER, RGB_DEFAULT, &x_start, &y_start, &width, &height, TRUE);      
  sprintf(buf, "   application API Example - Int_DrawRectangle\tWidth = %i, Height = %i pixels   ","width, height");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);        
  Wait(1.5);
  strcpy(buf, "   application API Example - Int_DrawRectangle\tPress primary mouse button to start. To cancel press Esc.   ");
  Int_CreateTextWindow(buf,0,RGB(0,0,128),RGB_WHITE,100);                         
  }
  }
if(ExistProc("ViewColor") == TRUE) ViewColor();
else                                   ViewGray();    
Int_CloseTextWindow();

See Also 
Int_DrawCircle, Int_DrawEllipse, Int_DrawLine, Int_DrawMarker, Int_DrawPoly

Int_MeasureHorizLineWithCenter

Description 

 Int_MeasureHorizLineWithCenter(
   int  lineMode
);

This function enables you to measure the distance using parallel lines and show the central line. The label is automatically added with length and its half. After calling this function, a predefined cursor appears and you can start drawing.

Parameters

int lineMode

Specifies the drawing mode.

1, LINE_GENERAL

Draw general parallel lines.

2, LINE_HORIZONTAL

Measure horizontal distance.

3, LINE_VERTICAL

Measure vertical distance.

See Also 
Int_DrawCircle, Int_DrawEllipse, Int_DrawLine, Int_DrawMarker, Int_DrawPoly