Click or drag to resize

IMcGeometryBlend Method

Blends a portion of a source image into a portion of another image.

Namespace:  MediaCy.IQL.Operations
Assembly:  MediaCy.IQL.Operations (in MediaCy.IQL.Operations.dll) Version: 10.0.6912.0
Syntax
VB
Function Blend ( 
	vSourceImg As Object,
	Optional ControlFlags As mcBlendControlFlags = mcBlendControlFlags.mcbcfDefault,
	Optional SourceBlendPercent As Integer = 100,
	<OptionalAttribute> DestRect As Object,
	<OptionalAttribute> SourceRect As Object,
	<OptionalAttribute> vDestImg As Object
) As McImage

Parameters

vSourceImg
Type: SystemObject
Required source image or IMcRegionAccess instance. For a source image the VARIANT may hold the IMcImage instance, a string image name or numeric index for an Item in the Images collection. If given as an IMcRegionAccess instance, the SourceRect argument is ignored and is the bounds of the IMcRegionAccess.
ControlFlags (Optional)
Type: MediaCy.IQL.OperationsmcBlendControlFlags
Control flags to determine what sorts of masking need to be done and how missing SourceRect and DestRect are to be interpreted.
SourceBlendPercent (Optional)
Type: SystemInt32
The percentage blending factor to use for combining source with destination. Each matched pixel will be blended using the following formula, ResultPixelLuminance = SourcePixelLuminance * SourceBlendPercent/100 + DestPixelLuminance * (100-SourceBlendPercent)/100 By default, the BlendPercent is 100, so that each source pixel completely replaces the destination pixel, thus making the default Blend operation equivalent to a Paste. Blending only is done for pixels that are not optionally masked by the source or destination Aoi and where the optional mcbcfBlendingStyleLighter or mcbcfBlendingStyleDarker ControlFlags criteria are met.
DestRect (Optional)
Type: SystemObject
Optional destination rectangle for the blend. This may be given as a LONGRECT structure or as a numeric array of length-4 in the order left, top, right, bottom. If given, the left and top must be given, but the right and/or bottom may be given as -1 to indicate that the width and/or height is to be matched to the source rectangle. If not given, then the left-top of the destination rectange is either the destination Aoi's left-top (the default) or if the mcbcfDefaultDestIsImage ControlFlags bit is set, it is 0,0, left-top of the destination image. The default size of the destination rectangle is the SourceRect size unless the mcbcfMaskByDestAoi ControlFlags bit is set, in which case the size will be limited by the destination Aoi bounds.
SourceRect (Optional)
Type: SystemObject
Optional source rectangle for the blend. This may be given as a LONGRECT structure or as a numeric array of length-4 in the order left, top, right, bottom. If not given, then the source rectange is either the source Aoi's bounds (the default) or the source image bounds the mcbcfDefaultSourceIsImage ControlFlags bit is set. The final blended rectangle is the intersection of the SourceRect aligned with the DestRect, each clipped to the source and destination Aoi or image bounds.
vDestImg (Optional)
Type: SystemObject
An optional destination image or %McRegionAccess% instance. For a destination image the VARIANT may hold the McImage instance, a string image name or numeric index for an Item in the Images collection. What is done with the destination depends on whether the McGeometry operator has a parent image; if so, then the vDestImg Aoi is copied into the parent image's Aoi and then the blending is done into the parent image. If the McGeometry operator is global or otherwise has no image parent, then the blend is done directly into the vDestImag. In this later case, if vDestImg is given as an %McRegionAccess% instance, the DestRect argument is ignored and is the bounds of the %McRegionAccess%.

Return Value

Type: McImage
The destination image.
Remarks
The Blend method is a more general version of the Paste method. It matches each pixel from a portion of a source image (optionally masked by the source image's Aoi) to each pixel in a matching portion (optionally masked by the Aoi) of a destination image (by default, the destination image is the parent image of the McGeometry operator). A pixel match may be optionally masked by the source and/or destination Aoi and pixels may be optionally blended only if the source pixel is lighter or darker that the corresponding destination pixel.
See Also