CImage:Attach
The Attach method associates a foreign image pointer with the CImage object. This permits CImage functionality to be used with the image not owned by the CImage.
bSuccess = CImage:Attach( pointer ) |
Using Attach provides CImage class functionality to be used with an image owned by another class, but the CImage does not own the foreign image or make a copy of it. Use this method, for example, to work with a displayed image that is owned by an image view window, but for that purpose it is usually preferable to use the CImageView:GetImage method.
Suppose an image window exists and is Wrapped by a CImageView object named V:
|
-- create a CImage object |
|
-- return a pointer to the current displayed image |
|
-- attach the pointer p to CImage I |
|
-- fetch the value of the pixel at coordinate (10,20) |
|
-- does not delete the image in V |