Leadtools.SpecialEffects Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
PaintImageEffect Method
See Also  Example
Leadtools.SpecialEffects Namespace > SpecialEffectsProcessor Class : PaintImageEffect Method




Applies an effect when painting a bitmap to a screen. The effect, commonly used for slide show transitions, specifies how the image is painted, not how it looks when painting is finished.

Overload List

Overload Description
PaintImageEffect(Graphics,RasterImage,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties,SpecialEffectsType,SpecialEffectsProgress) Applies an effect when painting a bitmap to a screen. The effect, commonly used for slide show transitions, specifies how the image is painted, not how it looks when painting is finished.  
PaintImageEffect(IntPtr,RasterImage,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties,SpecialEffectsType,SpecialEffectsProgress) Applies an effect when painting a bitmap to a screen. The effect, commonly used for slide show transitions, specifies how the image is painted, not how it looks when painting is finished.  

Example

This example shows the minimum requirements for using PaintImageEffect method to paint an image .

Visual Basic Copy Code
Public Sub PaintImageEffect(ByVal g As Graphics, ByVal destRect As Rectangle)
   Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor()
   Dim properties As RasterPaintProperties = New RasterPaintProperties()
   properties.RasterOperation = RasterPaintProperties.SourceCopy

   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()
   Dim rasterImage As RasterImage = codecs.Load("C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 15\Images\Image1.cmp")

   processor.PaintImageEffect(g, rasterImage, Rectangle.Empty, Rectangle.Empty, destRect, Rectangle.Empty, properties, SpecialEffectsType.SpiralIn, Nothing)

   rasterImage.Dispose()
   RasterCodecs.Shutdown()
End Sub
C# Copy Code
public void PaintImageEffect(Graphics g, Rectangle destRect) 

   SpecialEffectsProcessor processor = new SpecialEffectsProcessor(); 
   RasterPaintProperties properties = new RasterPaintProperties(); 
   properties.RasterOperation = RasterPaintProperties.SourceCopy; 
 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   RasterImage rasterImage = codecs.Load(@"C:\Program Files\LEAD Technologies, Inc\LEADTOOLS 15\Images\Image1.cmp"); 
 
   processor.PaintImageEffect(g, rasterImage, 
                              Rectangle.Empty, /* Default source rectangle */ 
                              Rectangle.Empty, /* Default source clip area */ 
                              destRect, /* Destination rectangle */ 
                              Rectangle.Empty, /* Default destination clipping rectangle */ 
                              properties, 
                              SpecialEffectsType.SpiralIn, /* Spiral effect */ 
                              null); 
 
   rasterImage.Dispose(); 
   RasterCodecs.Shutdown(); 
}

Remarks

If the screen has fewer colors than the image, this method dithers the output to that display surface without affecting the actual image data.

PaintImageEffect paints an image faster if its view perspective is bottom left. LEAD CMP images have a bottom-left view perspective, but some other formats have a top-left perspective. To get uniformly fast paints on all images, you can set the perspective after you load them. (You do not have to change them back before saving them in the original format, because the save methods set the orientation for the specified format.)

Multipass painting for the PushClass is disabled.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also