LEADTOOLS Special Effects (Leadtools.SpecialEffects assembly)

PaintTransition(Graphics,SpecialEffectsTransitionStyle,Color,Color,Int32,Rectangle,SpecialEffectsType,Int32,Int32,Int32,Int32,Int32,Int32,Boolean,Color,Int32,Color,Int32,SpecialEffectsProgress) Method

Show in webframe
Example 





The destination Graphics object.
Filling style during transition. For valid values, refer to SpecialEffectsTransitionStyle.
Value that specifies the background color. If a gradient transition is specified in the transitionStyle parameter, this is the beginning color for the gradient transition. Otherwise, it is the only color that is used.
Value that specifies the foreground color. If a gradient transition is specified in the transitionStyle parameter, this is the ending color for the gradient transition. Otherwise, this color is not used
Number of gradient color steps. This parameter is used only if a gradient transition is specified in the transitionStyle parameter. Valid values are 2 to 256.
Rectangle to be used as the display destination rectangle.
Effect to apply when painting. For valid values, refer to SpecialEffectsType.
This is the smallest size (pixel width or height) to be updated when painting an effect. Using a small grain makes the painting smoother, but takes longer to paint. Using a large grain makes the painting more coarse, but paints faster. If the effectType parameter is from the Wave class this represents the duration or height of the wave. Valid values are 1 to 256.
Delay between graining steps, in milliseconds.
Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the effectType parameter is from the Wave class.
Number of cycles or repetitions used to draw the wave. This parameter is valid only if the effectType parameter is from the Wave class.
Pass number when using a pattern brush. Use 1 for painting in one pass.
Maximum passes for a pattern brush. Use 1 for painting in one pass.
True to implement transparency by not painting pixels of the color specified in the transparentColor parameter; False if transparency is not implemented.
Value that specifies the transparency paint color.
Wand width, in pixels.
Value that specifies the wand color.
Windows ROP code for display. This parameter takes the same codes as the Windows BitBlt method. For ordinary painting, use SRCCOPY.
Callback method that will be called when the transition effect is started to determine the status for the transition effect.
Draws a rectangle onto the target device context with the specified fill pattern and color while using a special effect.
Syntax
public void PaintTransition( 
   Graphics g,
   SpecialEffectsTransitionStyle transitionStyle,
   Color backColor,
   Color foreColor,
   int steps,
   Rectangle destRect,
   SpecialEffectsType effectType,
   int grain,
   int delay,
   int speed,
   int cycles,
   int pass,
   int maxPass,
   bool transparency,
   Color transparentColor,
   int wandWidth,
   Color wandColor,
   int rasterOperation,
   SpecialEffectsProgress progressCallback
)
'Declaration
 
Public Overloads Sub PaintTransition( _
   ByVal g As Graphics, _
   ByVal transitionStyle As SpecialEffectsTransitionStyle, _
   ByVal backColor As Color, _
   ByVal foreColor As Color, _
   ByVal steps As Integer, _
   ByVal destRect As Rectangle, _
   ByVal effectType As SpecialEffectsType, _
   ByVal grain As Integer, _
   ByVal delay As Integer, _
   ByVal speed As Integer, _
   ByVal cycles As Integer, _
   ByVal pass As Integer, _
   ByVal maxPass As Integer, _
   ByVal transparency As Boolean, _
   ByVal transparentColor As Color, _
   ByVal wandWidth As Integer, _
   ByVal wandColor As Color, _
   ByVal rasterOperation As Integer, _
   ByVal progressCallback As SpecialEffectsProgress _
) 
'Usage
 
Dim instance As SpecialEffectsProcessor
Dim g As Graphics
Dim transitionStyle As SpecialEffectsTransitionStyle
Dim backColor As Color
Dim foreColor As Color
Dim steps As Integer
Dim destRect As Rectangle
Dim effectType As SpecialEffectsType
Dim grain As Integer
Dim delay As Integer
Dim speed As Integer
Dim cycles As Integer
Dim pass As Integer
Dim maxPass As Integer
Dim transparency As Boolean
Dim transparentColor As Color
Dim wandWidth As Integer
Dim wandColor As Color
Dim rasterOperation As Integer
Dim progressCallback As SpecialEffectsProgress
 
instance.PaintTransition(g, transitionStyle, backColor, foreColor, steps, destRect, effectType, grain, delay, speed, cycles, pass, maxPass, transparency, transparentColor, wandWidth, wandColor, rasterOperation, progressCallback)

            

            

Parameters

g
The destination Graphics object.
transitionStyle
Filling style during transition. For valid values, refer to SpecialEffectsTransitionStyle.
backColor
Value that specifies the background color. If a gradient transition is specified in the transitionStyle parameter, this is the beginning color for the gradient transition. Otherwise, it is the only color that is used.
foreColor
Value that specifies the foreground color. If a gradient transition is specified in the transitionStyle parameter, this is the ending color for the gradient transition. Otherwise, this color is not used
steps
Number of gradient color steps. This parameter is used only if a gradient transition is specified in the transitionStyle parameter. Valid values are 2 to 256.
destRect
Rectangle to be used as the display destination rectangle.
effectType
Effect to apply when painting. For valid values, refer to SpecialEffectsType.
grain
This is the smallest size (pixel width or height) to be updated when painting an effect. Using a small grain makes the painting smoother, but takes longer to paint. Using a large grain makes the painting more coarse, but paints faster. If the effectType parameter is from the Wave class this represents the duration or height of the wave. Valid values are 1 to 256.
delay
Delay between graining steps, in milliseconds.
speed
Speed of the wave. Valid values are 1 to 256. This parameter is valid only if the effectType parameter is from the Wave class.
cycles
Number of cycles or repetitions used to draw the wave. This parameter is valid only if the effectType parameter is from the Wave class.
pass
Pass number when using a pattern brush. Use 1 for painting in one pass.
maxPass
Maximum passes for a pattern brush. Use 1 for painting in one pass.
transparency
True to implement transparency by not painting pixels of the color specified in the transparentColor parameter; False if transparency is not implemented.
transparentColor
Value that specifies the transparency paint color.
wandWidth
Wand width, in pixels.
wandColor
Value that specifies the wand color.
rasterOperation
Windows ROP code for display. This parameter takes the same codes as the Windows BitBlt method. For ordinary painting, use SRCCOPY.
progressCallback
Callback method that will be called when the transition effect is started to determine the status for the transition effect.
Remarks

Use this method to create a special effect screen transition before painting the next image.

Use the grain and delay parameters to control the speed of the display. The grain parameter controls the size of the painting increment, and delay controls the time between increments.

The wand is a solid color bar that moves during an effect. Small grain sizes produce the best wand effects. Many of the effects listed in SpecialEffectsType can have a wand.

Use the pass and maxPass parameters to paint the image in more than one pass. For example, if you want a 3-pass paint, use maxPass of 3 and paint 3 times, once with pass = 1, once with pass = 2, and once with pass = 3.

Multipass painting for the PushClass is disabled.

If the effectType parameter is from the Twirl class, White Turnover class, Turnover class, Replace class, Laser class, Fade Normal class, Fade Black and White class, Fade Color class or Wave Class, the pass and maxPass parameters have no effect.

If the effectType parameter is from the Fade Normal class, Fade Black and White class or Fade Color class, the grain parameter has no effect. However, if the effectType parameter is from the Wave class, the grain parameter contains the wave size.

If the effectType parameter is from the White Turnover class, the Turnover class or the Replace class, the wandWidth and wandColor parameters have no effect. However, if the effectType parameter is from the Fade Color class, the wandColor parameter contains the bitmap color level.

The speed and cycles parameters have effect only if the effectType parameter is from the Wave class.

For general information, refer to Implementing Special Effects.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.SpecialEffects
Imports Leadtools.Drawing

Public Sub PaintTransition(ByVal g As Graphics, ByVal destRect As Rectangle)
   Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor()
   processor.PaintTransition(g, SpecialEffectsTransitionStyle.LineRToL, Color.Red, Color.Blue, 12, destRect, SpecialEffectsType.WipeRectangleIn, _
                             4, 10, 0, 0, 1, 3, False, Color.Empty, 0, Color.Black, RasterPaintProperties.SourceCopy, Nothing)
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.SpecialEffects;
using Leadtools.Drawing;

public void PaintTransition(Graphics g, Rectangle destRect)
{
   SpecialEffectsProcessor processor = new SpecialEffectsProcessor();
   processor.PaintTransition(g,
                              SpecialEffectsTransitionStyle.LineRToL,
                              Color.Red, /* background color, red */
                              Color.Blue, /* foreground color, blue */
                              12,                /* gradient color steps */
                              destRect, /* destination rectangle */
                              SpecialEffectsType.WipeRectangleIn, /* effect to apply when painting the transition */
                              4, /* graining size */
                              10, /* delay between graining steps */
                              0, /* speed of the wave */
                              0, /* number of cycles or repetitions */
                              1, /* step number for the pattern brush */
                              3, /* maximum steps for the pattern brush */
                              false, /* do not use transparency */
                              Color.Empty, /* no transparent color */
                              0, /* wand width */
                              Color.Black, /* no wand color */
                              RasterPaintProperties.SourceCopy,
                              null);
}
Requirements

Target Platforms

See Also

Reference

SpecialEffectsProcessor Class
SpecialEffectsProcessor Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.