Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.SpecialEffects
Imports Leadtools.Drawing
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
   Dim codecs As RasterCodecs = New RasterCodecs()
   Dim rasterImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"))
   processor.PaintImageRegionEffect(g, rasterImage, Rectangle.Empty, Rectangle.Empty, destRect, Rectangle.Empty, properties, SpecialEffectsType.SpiralIn, _
                                    AddressOf SpecialEffectsProgress)
   rasterImage.Dispose()
End Sub
Private Shared Function SpecialEffectsProgress(ByVal percent As Integer) As Boolean
   Console.WriteLine("{0}%", percent)
   Return True
End Function
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
             
   
     
            using Leadtools;
using Leadtools.Codecs;
using Leadtools.SpecialEffects;
using Leadtools.Drawing;
public void PaintImageRegionEffect(Graphics g, Rectangle destRect)
{
   SpecialEffectsProcessor processor = new SpecialEffectsProcessor();
   RasterPaintProperties properties = new RasterPaintProperties();
   properties.RasterOperation = RasterPaintProperties.SourceCopy;
   RasterCodecs codecs = new RasterCodecs();
   RasterImage rasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "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();
}
static bool SpecialEffectsProgress(int percent)
{
   Console.WriteLine("{0}%", percent);
   return true;
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}