Applies an effect when painting a bitmap region to a device context. This method works the same as PaintImageEffect, except that only the bitmap region is painted.
Overload List
Overload |
Description |
PaintImageRegionEffect(Graphics,RasterImage,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties,SpecialEffectsType,SpecialEffectsProgress) |
Applies an effect when painting a bitmap region to a device context. This method works the same as PaintImageEffect, except that only the bitmap region is painted. |
PaintImageRegionEffect(IntPtr,RasterImage,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties,SpecialEffectsType,SpecialEffectsProgress) |
Applies an effect when painting a bitmap region to a device context. This method works the same as PaintImageEffect, except that only the bitmap region is painted. |
Example
This example shows the minimum requirements for using PaintImageRegionEffect method to paint an image .
Visual Basic |
Copy Code |
Public Sub PaintImageRegionEffect(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.PaintImageRegionEffect(g, rasterImage, Rectangle.Empty, Rectangle.Empty, destRect, Rectangle.Empty, properties, SpecialEffectsType.SpiralIn, AddressOf SpecialEffectsProgress)
rasterImage.Dispose() RasterCodecs.Shutdown() End Sub
Private Shared Function SpecialEffectsProgress(ByVal percent As Integer) As Boolean Console.WriteLine("{0}%", percent) Return True End Function |
C# |
Copy Code |
public void PaintImageRegionEffect(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.PaintImageRegionEffect(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 */ SpecialEffectsProgress); rasterImage.Dispose(); RasterCodecs.Shutdown(); } static bool SpecialEffectsProgress(int percent) { Console.WriteLine("{0}%", percent); return true; } |
Remarks
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