RingEffect method (Main Control)
Builder Syntax |
int RingEffect(int nXOrigin, int nYOrigin, unsigned uRadius, unsigned uRingCount, unsigned uRandomize, unsigned crFill, int nAngle, unsigned uFlags); |
Delphi Syntax |
Function RingEffect (nXOrigin: L_INT; nYOrigin: L_INT; uRadius: L_UINT; uRingCount: L_UINT; uRandomize: L_UINT; crFill: COLORREF; nAngle: L_INT; uFlags: L_UINT): L_INT; |
Overview |
Refer to Applying Artistic Effects |
Remarks
(Raster Pro and above toolkits) Divides the image into the specified number of rings. Each ring is rotated according to a rotation angle. The rotation angle for each ring will be chosen randomly by the function or can be passed to the function.
This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.
Divides the image into a certain number of rings. Each ring is rotated compared to its inner ring according to a shift angle. The method will pick the shift angle at random if RING_FIXEDANGLE flag is not set in uFlags, or will use the angle specified by nAngle if RING_FIXEDANGLE is set in uFlags.
If RING_FIXEDANGLE flag is not set in uFlags then the method will pick the rotation angle randomly. The starting point (that is, the "randomization value") for the random number generator is selected through the uRandomize parameter, as follows:
If uRandomize
is set to zero then the method will select a random value between 1 and
500 for the randomization value.
If uRandomize
is > 0, it will be
used for the randomization value. Note that uRandomize
should be between 1 and 500 in this case.
Although the numbers generated are random, if you start with the same randomization value you will always get the same sequence of random numbers. This means that if you call the method twice with the same value for uRandomize, you will get the same result.
The center of the rings is determined by the nXOrigin and nYOrigin parameters. The method calculates the width of each ring by dividing the maximum radius (uRadius when uFlags is set to RING_MAXRADIUS) by the number of rings (uRingCount + 1).
The minimum width of each circle is 2. If the result of the division is less than 2, the method will draw uRadius / 2 rings, each ring having a width of 2.
Rings with a large radius might not be completely inside the bitmap. We will refer to these as "incomplete rings". We will refer to a portion of the ring that is outside the bitmap as "undetermined portion". When you rotate an incomplete ring, an undetermined portion of the ring might come into view. The method has 3 ways of specifying the output of the pixels where undetermined portions come into view:
Leave original bitmap pixels unchanged (RING_NOCHANGE
is set) or
Repeat edge pixels (RING_REPEAT is set) or
Fill the undefined area with color crFill (RING_COLOR is set).
The determined portion of the ring will always displace the original bitmap pixels.
The image is split into an innermost circle and a number of rings. The innermost circle will not be rotated. Each ring is rotated compared to the inner ring. The rotation angle is as follows:
If RING_FIXEDANGLE is set, each ring will
be rotated against its inner ring by nAngle. In other words, each index
will be rotated against the original position by nAngle * <ring index>.
(The index is 0-based. The innermost circle is considered to have an index
of 0 and will not be rotated).
If RING_FIXEDANGLE is not set, the method
will pick random rotation angles for each ring.
The width of the ring is determined as follows:
If RING_RADIUS is set, uRadius is the width
of each ring
If RING_MAXRADIUS is set, uRadius will be
the maximum ring radius. In this case, the width of each ring will be
uRadius / uRingCount + 1.
This method supports all bits/pixel supported by LEADTOOLS.
Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
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.
See Also
Elements: |
Mosaic method, Picturize method, Pixelate method, Cubism method, DiceEffect method, PuzzleEffect method. |
Topics: |
|
|