Description

Change a block of pixel values of the image.

Return Type

A Long value.  

The number of values set. Should be (right - left + 1)*(bottom - top + 1)*image.NumberOfChannels.

Syntax

object.PutArea (vArea, [lLeft], [lTop], [lRight], [lBottom], [lFrame])

The PutArea Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McImage.
vAreaRequired. A Variant value.

A VARIANT containing a SAFEARRAY containing the new pixel values. The number of values contained in the SAFEARRAY should be equal to the height times width of the image times the number of channels (3 for color images). For color images, red, green, and blue values must be interlaced.

left

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

top

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

right

Optional. 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

Optional. 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

frame

Optional. 0-based frame number, McActiveFrame, McLastFrame.

Default

McActiveFrame.

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

Remarks

See CreateRegionAccess for a more controlled way to set pixel values.

Notes

Avoid using GetArea followed by PutArea to copy large image frames. This causes the entire image frame being copied to need to reside in memory. Instead use the McRegionAccess.CopyInEntireArea method. Or set up your own per line loop and use GetLine followed by PutLine (you will need to call BeginEndUpdateBlock(TRUE/FALSE) around such a loop to avoid excessive image updating).