Description

Create an McRegionAccess that bounds this McFeatures and is masked by it if this is an McRegions.

Return Type

A McRegionAccess object.  

The new McRegionAccess

Syntax

object.AccessMaskedImageData ([Type], [Channel], [Frame], [varImage])

The AccessMaskedImageData Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McFeatures.
TypeOptional. A Variant value.

a QuickImageTypes or an McImageType

ChannelOptional. A Long value.

minus 1 for all channels, or 0-based channel number

FrameOptional. A Long value.

McActiveFrame, McLastFrame, or 0-based frame number

varImageOptional. A Variant value.

an optional source for the image data. If supplied this must be an McImage instance or one of the legal arguments for the McImages.Item property. If this argument is not supplied (i.e., is VT_EMPTY or VT_ERROR), then this McFeatures must have a parent McImage, which is used as the source for the image data.

Remarks

The bounds of the created McRegionAccess are the same as the Bounds property. Since McRegionAccess gives access to pixel values in an image, the McFeatures must be associated with a parent image or the optional varImage argument must be given.

If the McFeatures is “reset” (IsReset true), an McRegionAccess that covers the entire image will be created. If the McFeatures is “empty” (i.e., some operation has left it with no features), then an error is generated; test for IsEmpty false to avoid this error (see Reset for more discussion).

Except for the absence of left, top, right, bottom arguments which are properties of the region, this method has the same arguments as McImage.CreateRegionAccess()

If this McFeatures is an McRegions and the McRegions is not “Reset” (IsReset returns FALSE) and if it is not a single, simple mcftBox, then after the McRegionAccess is created, this McRegions is assigned as its RegionMask property. You can subsequently call Set McRegionAccess.RegionMask = Nothing, or you can call McImage.CreateRegionAccess instead of this method if you want unmasked writes to the image. There is no need to set the McRegionAccess.RegionMask property if this IsReset or a simple mcftBox, since only the bounds of the McRegionAccess matter in this case.

Exceptions

Fails if IsEmpty is true or if no source image can be resolved.