←Select platform

SourcePoint Property

Summary
Gets or sets the point structure that contains the origin of the source rectangle.
Syntax
C#
VB
Objective-C
C++
Java
publicLeadPointSourcePoint {get;set; }
PublicPropertySourcePointAsLeadPoint
@property (nonatomic, assign) LeadPoint sourcePoint
publicLeadPoint getSourcePoint()publicvoidsetSourcePoint(LeadPoint value)
public:propertyLeadPointSourcePoint {LeadPointget();voidset (LeadPoint);}

Property Value

LeadPoint structure that contain the origin of the source rectangle. the Width and Height are the same Width and Height for the destination rectangle.

Example

Run theAlphaBlendCommandon an image.

C#
VB
usingLeadtools;usingLeadtools.Codecs;usingLeadtools.ImageProcessing.Effects;publicvoidSourcePointPropertyExample(){// Load an imageRasterCodecs codecs =newRasterCodecs();codecs.ThrowExceptionsOnInvalidImages =true;RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"Master.jpg"));// Prepare the commandRasterImage srcImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,@"ImageProcessingDemo\Image3.cmp"), 24, CodecsLoadByteOrder.Bgr, 1, 1);AlphaBlendCommand command =newAlphaBlendCommand();// Combine srcImage with image, with half opacity.//command.DestinationRectangle = new LeadRect(image.Width / 2 - srcImage.Width / 2, image.Height / 2 - srcImage.Height / 2, image.Width / 2 + srcImage.Width / 8, image.Height / 2 + srcImage.Height / 8);command.DestinationRectangle =newLeadRect(image.Width / 8, image.Height / 8, image.Width, image.Height);command.SourceImage = srcImage;command.SourcePoint =newLeadPoint(0, 0);command.Opacity = 128;command.Run(image);codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir,"Result.jpg"), RasterImageFormat.Jpeg, 24);}staticclassLEAD_VARS{publicconststringImagesDir =@"C:\LEADTOOLS21\Resources\Images";}
ImportsLeadtoolsImportsLeadtools.CodecsImportsLeadtools.ImageProcessing.EffectsPublicSubSourcePointPropertyExample()DimcodecsAsNewRasterCodecs()codecs.ThrowExceptionsOnInvalidImages =TrueDimleadImageAsRasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"Master.jpg"))' Prepare the commandDimsrcImageAsRasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"ImageProcessingDemo\image3.cmp"), 24, CodecsLoadByteOrder.Bgr, 1, 1)DimAsInteger=CType((leadImage.Width / 8),Integer)DimTopAsInteger=CType((leadImage.Height / 8),Integer)DimWidthAsInteger=CType((leadImage.Width),Integer)DimHeightAsInteger=CType((leadImage.Height),Integer)' Combine srcImage with image, with half opacity.DimcommandAsAlphaBlendCommand =NewAlphaBlendCommandcommand.DestinationRectangle =NewLeadRect(Left, Top, Width, Height)command.SourceImage = srcImagecommand.SourcePoint =NewLeadPoint(0, 0)command.Opacity = 128command.Run(leadImage)codecs.Save(leadImage, 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.