DOTREMOVE

typedef struct _DOTREMOVE
{
   L_UINT uStructSize;
   L_UINT uFlags;
   L_INT iMinDotWidth;
   L_INT iMinDotHeight;
   L_INT iMaxDotWidth;
   L_INT iMaxDotHeight;
   pBITMAPHANDLE pBitmapRegion;
   L_UINT uBitmapStructSize;
   HRGN hRgn;
} DOTREMOVE, *pDOTREMOVE;

The DOTREMOVE structure provides dot removal information for the LBitmap::DotRemove function.

Member

Description

uStructSize

Size of this structure in bytes. Use the sizeof() macro to calculate this value.

iSize

Size of this structure.

uFlags

Flags that determine the behavior of the dot removal process. Flags may be combined using a bitwise OR (|). Possible values are:

 

 

Value

Meaning

 

DOT_SINGLE_REGION:

For each dot encountered by LBitmap::DotRemove, if the LBitmap::DotRemoveCallback callback member function returns SUCCESS_REMOVE, the removed dot is added to an internal single region. If the callback member function returns SUCCESS_NOREMOVE, the dot is not added to the single region. When LBitmap::DotRemove returns, either pBitmapRegion or hRgn will reference a region that contains all the removed dots. If DOT_LEAD_REGION is also set, pBitmapRegion will be updated with a shallow copy of pBitmap that has a LEAD region that contains all the removed dots. If DOT_LEAD_REGION is not set, hRgn is updated with a Windows region that contains all the removed borders. When the region (either LEAD or Windows) is no longer needed, it must be destroyed (either pBitmapRegion->pRgnInfo or hRgn).

 

DOT_LEAD_REGION

When LBitmap::DotRemove returns, pBitmapRegion is updated with a shallow copy of pBitmap that also contains a region with all the removed dots. This flag must be used in conjunction with DOT_SINGLE_REGION. To use this flag declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to DOT_SINGLE_REGION | DOT_LEAD_REGION. This variable will be updated when LBitmap::DotRemove returns.

 

DOT_IMAGE_UNCHANGED

The original image is unchanged.

 

DOT_USE_DPI

The unit of measure for all fields of the DOTREMOVE structure is thousandths of an inch. Use the image's DPI to convert to pixels. This allows the processing of many images with different DPI. If this flag is not set, the unit of measure for all fields of the DOTREMOVE structure is pixels.

 

DOT_CALLBACK_REGION

LBitmap::DotRemoveCallback callback member function receives a Windows region that contains the current dot to be removed. Setting this flag lets the user create his or her own composite of removed dots by combining the regions received by the callback member function, if the callback member function returns SUCCESS_REMOVE. The regions can be combined using a logical OR operator. Combining all regions received when the callback function returns SUCCESS_REMOVE results in a region identical to the region created when DOT_SINGLE_REGION is set in uFlags. For an example, refer to LBitmap::DotRemove. When the region received by the callback function is no longer needed, it must be destroyed using DeleteObject().

 

DOT_USE_SIZE

Use the iMinDotWidth, iMinDotHeight, iMaxDotWidth, iMaxDotHeight members of the DOTREMOVE structure to indicate the size of the dots to remove. If this flag is not set, default values for the four sizes will be used. These defaults are as follows: iMinDotWidth = 1, iMinDotHeight = 1, iMaxDotWidth = 2 and iMaxDotHeight = 2.

 

DOT_USE_DIAGONALS

Considers pixels that are diagonal as part of the dot. Consider the "speck" below consisting of nine pixels.

 

image\DotDiag.gif

 

 

 

If DOT_USE_DIAGONALS is used, this speck is considered a single dot that is 5x5 pixels. If DOT_USE_DIAGONALS is not used, the speck is considered three dots (2x2, 1x1, 2x2).

 

DOT_ALLFLAGS

Use all behaviors of the dot removal process.

 

iMinDotWidth:

The minimum width of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.

iMinDotHeight:

The minimum height of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.

iMaxDotWidth:

The maximum width of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.

iMaxDotHeight:

The maximum height of a dot to be removed. If DOT_USE_DPI is set in uFlags, units are in thousandths of an inch, otherwise units are in pixels.

pBitmapRegion

Pointer to a variable of type BITMAPHANDLE. If DOT_SINGLE_REGION | DOT_LEAD_REGION have been set in uFlags, then when LBitmap::DotRemove returns, this is updated with a shallow copy of pBitmap that also has a region that contains the removed dots. To use this, declare a variable of type BITMAPHANDLE and point pBitmapRegion to this variable. Set uFlags to (DOT_SINGLE_REGION | DOT_LEAD_REGION). It is the programmer's responsibility to free the region using LBitmapRgn::Free() when it is no longer needed. Refer to the LBitmap::DotRemove example to see how pBitmapRegion is used and freed.

uBitmapStructSize

Size of the structure pointed to by pBitmap. Use sizeof(BITMAPHANDLE).

hRgn

Handle to a windows region. When LBitmap::DotRemove returns, this is updated with a single windows region corresponding to all changes, only if DOT_SINGLE_REGION has been set in uFlags and DOT_LEAD_REGION has not been set. To use this, set the flags field to (DOT_SINGLE_REGION). It is the programmer's responsibility to delete this region using the windows API DeleteObject() when the region is no longer needed.