Leadtools.SpecialEffects Namespace > SpecialEffectsProcessor Class > PaintImageEffect Method : PaintImageEffect(IntPtr,RasterImage,Rectangle,Rectangle,Rectangle,Rectangle,RasterPaintProperties,SpecialEffectsType,SpecialEffectsProgress) Method |
public void PaintImageEffect( IntPtr hdc, RasterImage image, Rectangle src, Rectangle srcClip, Rectangle dest, Rectangle destClip, RasterPaintProperties paintProperties, SpecialEffectsType effectType, SpecialEffectsProgress progressCallback )
'Declaration Public Overloads Sub PaintImageEffect( _ ByVal hdc As IntPtr, _ ByVal image As RasterImage, _ ByVal src As Rectangle, _ ByVal srcClip As Rectangle, _ ByVal dest As Rectangle, _ ByVal destClip As Rectangle, _ ByVal paintProperties As RasterPaintProperties, _ ByVal effectType As SpecialEffectsType, _ ByVal progressCallback As SpecialEffectsProgress _ )
'Usage Dim instance As SpecialEffectsProcessor Dim hdc As IntPtr Dim image As RasterImage Dim src As Rectangle Dim srcClip As Rectangle Dim dest As Rectangle Dim destClip As Rectangle Dim paintProperties As RasterPaintProperties Dim effectType As SpecialEffectsType Dim progressCallback As SpecialEffectsProgress instance.PaintImageEffect(hdc, image, src, srcClip, dest, destClip, paintProperties, effectType, progressCallback)
public: void PaintImageEffect( IntPtr hdc, RasterImage^ image, Rectangle src, Rectangle srcClip, Rectangle dest, Rectangle destClip, RasterPaintProperties paintProperties, SpecialEffectsType effectType, SpecialEffectsProgress^ progressCallback )
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.
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.SpecialEffects Imports Leadtools.Drawing 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 Dim codecs As RasterCodecs = New RasterCodecs() Dim rasterImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp")) processor.PaintImageEffect(g, rasterImage, Rectangle.Empty, Rectangle.Empty, destRect, Rectangle.Empty, properties, SpecialEffectsType.SpiralIn, Nothing) rasterImage.Dispose() End Sub 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 PaintImageEffect(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.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(); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }