Class Hierarchy
AcRxObject AcGiDrawable AcDbObject AcDbEntity AcDbImage AcDbRasterImage AcDbGeoMap AcDbWipeout
C++
class AcDbRasterImage : public AcDbImage;
File
imgent.h
Description
The AcDbRasterImage entity (or "image entity") works with the AcDbRasterImageDef object (or "image definition object") to implement raster images inside AutoCAD. The relationship between these two classes is much like the relationship between an AutoCAD block definition object and a block insert entity.
The image entity is a drawable, selectable AutoCAD entity that places a raster image in model or paper space at a particular location and orientation. The image entity is linked to exactly one image definition object, to which it sends requests for image processing operations needed for displaying and plotting images. Because the image definition object manages all the image information, the image entity is relatively small. Besides the image location and orientation, it contains a clip boundary, image fade, contrast and brightness parameters and other typical AcDbEntity properties like layer and color.
Two or more image entities can be linked to a single image definition object. Since each image entity has its own clip boundary, this is an efficient way to display different regions of a single raster image at different positions in the drawing.
The AcDbRasterImage entity must sometimes translate between two coordinate systems: 3D model coordinates in which AcDbEntities live and 2D pixel coordinates that the AcDbRasterImageDef object understands. For this purpose, the image entity carries inside it a planar bounding rectangle, specified in 3D World Coordinates, that outlines the raw image boundary as it floats in space. Several API functions are available to help translate between pixel and model coordinates.
The image definition object plays a behind-the-scenes role like the block definition, maintaining links to the source image file and managing low-level image processing operations required to display and plot images. Image definition objects are stored in a special AutoCAD dictionary. They are not AutoCAD entities, so they can't be displayed or selected directly by the end user. They understand only 2D pixel coordinates, so all image processing requests must be expressed as 2D operations.
Image processing operations, like scaling and rotating the image for display, are executed by the Autodesk Image Engine. The Image Engine has its own extensive developer API on which sophisticated image editing applications can be built. (Information on the Autodesk Image Engine is available through the Autodesk Developer Program.)
Class AcDbRasterImage is implemented in an ObjectARX application called acISMui.arx. Your application must link to the ObjectARX API library acISMobj17.lib to use any of the methods specific to this class.
Note that the AcDbEntity methods on this class can be accessed without linking to acISMobj17.lib. Simply cast the object pointer (for example, as returned by acdbOpenObject) to class AcDbEntity.
The AcDbRasterImage entity cannot be used by itself. It must be linked to an AcDbRasterImageDef object to display images by calling AcDbRasterImage::setImageDefId. Furthermore, an AcDbRasterImageDefReactor must be constructed and linked to AcDbRasterImage entity and AcDbRasterImageDef object.
(Sample code showing how to create and link the AcDbRasterImage, AcDbRasterImageDef, and AcDbRasterImageDefReactor appears in the samplesmiscism directory of the ObjectARX tree.)
Remarks
The "u" vector returned by getOrientation() is the X-axis of the image. You may use this vector to get the angle between it and the current UCS X-axis or the image's entity coordinate system X-axis as desired.
Links
AcDbRasterImage Enumerations, AcDbRasterImage Methods
See Also
AcDbObject, AcDbEntity, AcDbImage, AcDbRasterImageDef, AcDbRasterImageDefReactor, AcDbRasterVariables, Image Support Module Overview