Next: , Previous: CADAddEllipseArc, Up: CAD areas and methods


6.14 CADAddImage

CADAddImage creates a Raster image from a picture and adds it to a drawing or a block.

IO Parameter Type Description
in theCADArea longint Area ID
in theBlockID longint A Block ID or kCADRootBlockID for the root drawing
in theLayerOrSubLayerID longint Layer ID or Sublayer ID
in theAnchorX real See Raster image. The insertion point X-coordinate
in theAnchorY real See Raster image. The insertion point Y-coordinate
in theImageAlignH integer A raster image alignment constant
in theImageAlignV integer A raster image alignment constant
in theTransparentFlag integer A boolean constant (see Raster image)
in theScanResolutionH real See Handling raster image resolutions
in theScanResolutionV real See Handling raster image resolutions
in thePrintResolutionH real See Handling raster image resolutions
in thePrintResolutionV real See Handling raster image resolutions
in theRotation real See Raster image and Angle
in thePixelType integer Pass kCADPixelTypeBW or kCADPixelTypeColor
in theRasterPicture Picture Picture field or variable. Vector information is converted to raster information
out theNewObjID longint Object ID of the new object
out function result OSErr Error result code, also see Error handling

Resolution formulas

Resolution [in dpi] = UnitsPerInch [ in Unit/Inch ] * NumberOfPixels / Size [ in Unit]

Size [in Unit] = UnitsPerInch [ in Unit/Inch ] * NumberOfPixels / Resolution [ in dpi]

So, for example, if the CAD unit is mm:

Resolution [in dpi] = 25.4 * NumberOfPixels / Size [ in Unit]

Size [in Unit] = 25.4 * NumberOfPixels / Resolution [ in dpi]

Related methods
CADGetImage, CADSetImage, CADGetImageXY, CADSetImageXY, CADObjImage, CADCalcImageResolution, CADCalcImageMatrix, CADGetImageInfo CADGetImageFile, CADGetImageFileInfo and CADImportImage.