Share

AcDbRasterImageDef::forceImageFileClosed Method

C++

Acad::ErrorStatus forceImageFileClosed(
    Adesk::Boolean modifyDatabase
);

Description

This method will cause the AcDbRasterImageDef to close the file that is the source of the image data for the object. The file is closed and so it can be overwritten/deleted.

Extreme caution must be exercised in the use of this function; while the file is closed and may be altered, the AcDbRasterImageDef is still in a "loaded" state. It expects to be able to access the file and that it's contents will be consistent with the internal caches that it maintains. If this is not the case serious errors including hard crashes will result.

To alter the file that is held by an AcDbRasterImageDef it is strongly recommended to first call unload() and alter the file, then call load() to reload the AcDbRasterImageDef. This will resynchronize the internal caches with the new file data.

Parameters

Parameters Description
modifyDatabase Input Boolean indicating whether to do undo recording

Notes

This method will force the ISM to release its hold on the image file. This is a dangerous thing to do since if the image file is released it may be erased or changed while the ISM continues to refer to it. The ISM holds many items about the image in the file. If any of the statistics of the image within the image file, or the format of the image file, while the ISM remains in a "loaded" state, are changed, then it can cause serious errors that could result in drawing or work loss (through an exception).

Take care in making use of this function to alter the look of an image without unloading and reloading it from the ISM. Its use is not recommended.

Links

AcDbRasterImageDef

Was this information helpful?