ImageWidth Example

Using Programming Languages other than VBA

Sub Example_ImageWidth()
	' This example adds a raster image in model space and then finds
	' the height and width of the image.

	' This example uses the "downtown.jpg" found in the Sample
	' directory. If you do not have this image, or if it is located
	' in a different directory, insert a valid path and file name
	' for the imageName variable below.

	Dim insertionPoint(0 To 2) As Double
	Dim scalefactor As Double
	Dim rotationAngle As Double
	Dim imageName As String
	Dim rasterObj As AcadRasterImage
	imageName = "C:/AutoCAD/sample/downtown.jpg"
	insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
	scalefactor = 1#
	rotationAngle = 0

	' Creates a raster image in model space
	Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)

	' Find the height and width of the raster image
	Dim height As Variant
	Dim width As Variant

	height = rasterObj.ImageHeight
	width = rasterObj.ImageWidth

	MsgBox "Raster image: " & rasterObj.ImageFile & vbCrLf & _
			"ImageHeight: " & str(height) & vbCrLf & _
			"ImageWidth: " & str(width)
		
End Sub

 

   Comments? 
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@entercad.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.