←Select platform

FeatherAlphaBlendCommand Class

Summary
Combines image data from two images with feathering. The two images can be combined with variable opacity applied by specifying the region of a fade mask image.
Syntax
C#
VB
Objective-C
C++
Java
publicclassFeatherAlphaBlendCommand :RasterCommand
PublicClassFeatherAlphaBlendCommandInheritsRasterCommand
@interfaceLTFeatherAlphaBlendCommand : LTRasterCommand
publicclassFeatherAlphaBlendCommandextendsRasterCommand
publicref classFeatherAlphaBlendCommand :publicRasterCommand
Remarks
  • To combine two images with a fixed opacity, use theAlphaBlendCommand.
  • The FeatherAlphaBlendCommand achieves feathering between two images by using variable opacity values, obtained from the fade mask referenced byMaskImage. Use theMaskSourcePointto specify a region of the mask image, these values are the coordinates of the origin of the mask rectangle.
  • To create an image that contains a fade mask, useFadedMaskCommandcommand.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in theDocument/Medicaltoolkits.
  • This command does not support signed data images.
  • This command does not support 32-bit grayscale images.

For more information, refer toIntroduction to Image Processing With LEADTOOLS.

Example

Run theFeatherAlphaBlendCommandon an image.

C#
VB
usingLeadtools;usingLeadtools.Codecs;usingLeadtools.ImageProcessing.Effects;publicvoidFeatherAlphaBlendCommandExample(){// Load an imageRasterCodecs codecs =newRasterCodecs();RasterImage backgroundImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"Image1.cmp"));RasterImage sourceImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"LittleGFlyingAlpha.png"), 32, CodecsLoadByteOrder.Bgr, 1, 1);FeatherAlphaBlendCommand command =newFeatherAlphaBlendCommand();command.DestinationRectangle =newLeadRect(0, 0, sourceImage.Width, sourceImage.Height);command.MaskImage = sourceImage.CreateAlphaImage();command.SourceImage = sourceImage;command.SourcePoint =newLeadPoint(0, 0);command.Run(backgroundImage);codecs.Save(backgroundImage, Path.Combine(LEAD_VARS.ImagesDir,"Result.jpg"), RasterImageFormat.Jpeg, 24);}staticclassLEAD_VARS{publicconststringImagesDir =@"C:\LEADTOOLS21\Resources\Images";}
ImportsLeadtoolsImportsLeadtools.CodecsImportsLeadtools.ImageProcessing.EffectsPublicSubFeatherAlphaBlendCommandExample()' Load an imageDimcodecsAsRasterCodecs =NewRasterCodecs()DimbackgroundImageAsRasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"Image1.cmp"))DimsourceImageAsRasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"LittleGFlyingAlpha.png"), 32, CodecsLoadByteOrder.Bgr, 1, 1)DimcommandAsFeatherAlphaBlendCommand =NewFeatherAlphaBlendCommand()command.DestinationRectangle =NewLeadRect(0, 0, sourceImage.Width, sourceImage.Height)command.MaskImage = sourceImage.CreateAlphaImage()command.SourceImage = sourceImagecommand.SourcePoint =NewLeadPoint(0, 0)command.Run(backgroundImage)codecs.Save(backgroundImage, Path.Combine(LEAD_VARS.ImagesDir,"Result.jpg"), RasterImageFormat.Jpeg, 24)EndSubPublicNotInheritableClassLEAD_VARSPublicConstImagesDirAsString="C:\LEADTOOLS21\Resources\Images"EndClass
Requirements

Target Platforms

Leadtools.ImageProcessing.Effects Assembly
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.