SetRgnMagicWand method (Main Control)
Builder syntax |
L_INT SetRgnMagicWand(L_INT x, L_INT y, COLORREF crLowerTolerance, COLORREF crUpperTolerance, L_UINT uCombineMode); |
Delphi syntax |
Function SetRgnMagicWand (x: L_INT; y: L_INT; crLowerTolerance: COLORREF; crUpperTolerance: COLORREF; uCombineMode: L_UINT ): L_INT; |
Overview |
Refer to Creating and Using a Bitmap Region |
Remarks
Sets a region based on the color found at point x, y in the region.
With this method, you can either replace the current region or create a complex region by setting a flag that determines how the added region interacts with the existing region. For possible values, specified in the iCombineMode parameter, refer to Flags for Setting a Region.
For color bitmaps:
If the value at pixel (x, y) is (125, 125, 125) and crLowerTolerance is (20, 30, 15) the lower stopping point is (105, 95, 110). If crUpperTolerance is (10, 25, 20), then the upper stopping point is (135, 150, 145). Pixels with values of (105, 95, 110) up to (135, 150, 145) will be included in the region.
For gray scale bitmaps:
The minimum channel tolerance value of crLowerTolerance will be used to set the lower stopping point, and the value of crUpperTolerance will be used to set the upper stopping point. For example, if the value of the pixel at (x, y) is (125, 125, 125) and crLowerTolerance is (20,30,15), the smallest value of the triplet (15) will be used to create the lower stopping point of (110,110,110). If crUpperTolerance is (10,25,20), the smallest value of that triplet (10) will be used to create the upper stopping point of (135,135,135).
This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.
This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
See Also
Elements: |
|
Topics: |
|
|