| ImageEn, unit imageenview |
|
TImageEnView.SelectMagicWand
Declaration
procedure SelectMagicWand(x, y: Integer; Op: TIESelOp = iespReplace; CheckAlpha: Boolean = False);
Description
Selects an irregular region that has similar colors.
It uses the following properties:
◼MagicWandMode
◼MagicWandSize
◼MagicWandTolerance
◼MagicWandMaxFilter
| Parameter | Description |
| x | Starting horizontal coordinate |
| y | Starting vertical coordinate |
| Op | If Op is iespReplace the region replaces the existing selection, otherwise if Op is iespAdd, the region is appended to the existing selection |
| CheckAlpha | If true, it also considers the AlphaChannel when matching |
Note:
◼If
SelectionBase = iesbClientArea then x and y are assumed to be visible points on the control. If iesbBitmap, the points specify a position on the bitmap.
◼This is the programmatic equivalent of setting
miSelectMagicWand in
MouseInteractGeneral
◼MagicWandMode determines the nature of the magic wand selection. For
iewInclusive a "vectorized" selection is created (i.e. the selection will be made up of a series of lines and can be accessed via
PolySel). For other types a "bitmap" selection is used (to determine whether specific pixels are selected, use
IsPointInsideSelection)
◼View a
preview of all selection types
Demo
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
Example
// Create a "flood fill" type selection and discard red and green channels
ImageEnView1.MagicWandTolerance := 24;
ImageEnView1.MagicWandSize := 1;
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.SelectMagicWand( 588, 217 );

ImageEnView1.Proc.Proc.DisposeChannels( 'B00' );

Other Selection Methods
◼Select
◼SelectEllipse
◼SelectChromaKey
◼SelectRoundRect
◼SelectShape
◼SelectCustom
View a
preview of all selection types
See Also
◼SelectionBase
◼SelectionIntensity
◼SelectColors
◼SelectChromaKey