AddImage method example

Private Sub CommandButton12_Click()

     'This example adds an image to the drawing and determines its properties.

     Dim insPoint As IntelliCAD.Point

     Dim scalefactor As Double

     Dim rotationAngle As Double

     Dim imageName As String

     Dim rasterObj As IntelliCAD.Image

     ' Select the image.

     imageName = "C:\Program Files\IntelliCAD2001\Samples\Dallas.bmp"

     Set insPoint = Library.CreatePoint(4, 2, 0)

     scalefactor = 1

     rotationAngle = 0

 

     ' Add the image in model space

     Set rasterObj = ThisDocument.ModelSpace.AddImage(imageName, insPoint, scalefactor, rotationAngle)

     rasterObj.Update

     ThisDocument.ActiveViewport.ZoomExtents

     ' Determine properties of the image

     MsgBox "The image file is: " & rasterObj.ImageFile

     MsgBox "The image height is: " & rasterObj.ImageHeight & Chr(13) & "The image width is: " & rasterObj.ImageWidth

     MsgBox "The image visibility is: " & rasterObj.ImageVisibility

End Sub