Description

Create an McRegionAccess interface for read/write pixel access.

Return Type

A McRegionAccess object.  

A new McRegionAccess instance allowing read-write pixel access to pixels of the given Type in the given Frame for the given Channel within the given limits.

Syntax

object.CreateRegionAccess ([Type], [Channel], [Frame], [lLeft], [lTop], [lRight], [lBottom])

The CreateRegionAccess Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McImage.
TypeOptional. A Variant value.
ChannelOptional. A Long value.

values are considered. When given, the McRegionAccess Get* and Put* methods effectively access the given Channel as a monochrome array of pixels.

Frame

If given, the 0-based frame index of the frame to be accessed. Other allowed values are McActiveFrame and McLastFrame. McActiveFrame is the default.

Left

Left side of the read/write area. Must be between 0 and image.width-1. The default value of -1 is the same as 0.

Top

Top side of the area. Must be between 0 and image.height-1. The default value of -1 is the same as 0.

Right

Right side of the area. Must be between 0 and image.width-1. The default value of -1 is the same as image.width-1

Bottom

Bottom side of the area. Must be between 0 and image.height-1. The default value of -1 is the same as image.height-1

FrameOptional. A Long value.
lLeftOptional. A Long value.
lTopOptional. A Long value.
lRightOptional. A Long value.
lBottomOptional. A Long value.

Remarks

This method creates an McRegionAccess instance with read-write access to pixels. Use the CreateRegionAccessEx method to create an McRegionAccess instance with read-only or write-only access. CreateRegionAccessEx also allows specification of the region-of-interest as an array or LONGRECT rather than as four separate values.

A McRegionAccess instance gives full control over access to pixel values. For simple pixel access, use GetPixel / PutPixel, GetLine / PutLine, GetArea / PutArea.

The source Type.MinCastingLuminance and Type.MaxCastingLuminance can be set by assigning to the CastingSourceRange property. CastingSourceRange is always reset to its default value (RangeMin to RangeMax) after any call to CreateRegionAccess.