Contrast Example |
Using Programming Languages other than VBA
Sub Example_Contrast() ' This example inserts a raster image and finds the current ' Contrast of the image. It then changes the Contrast ' of the image. ' This example uses the "downtown.jpg" found in the Sample ' directory. If you do not have the image, or if it is located ' in a different directory, insert a valid path and name for the ' imageName variable below. Dim insertionPoint(0 To 2) As Double Dim scalefactor As Double Dim rotAngleInDegree As Double Dim rotAngle As Double Dim imageName As String Dim raster As AcadRasterImage imageName = "C:\AutoCAD\sample\downtown.jpg" insertionPoint(0) = 2#: insertionPoint(1) = 2#: insertionPoint(2) = 0# scalefactor = 1# rotAngleInDegree = 0# rotAngle = rotAngleInDegree * 3.141592 / 180# On Error Resume Next ' Creates a raster image in model space Set raster = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotAngle) If Err.Description = "File error" Then MsgBox imageName & " could not be found." Exit Sub End If ' Find the current Contrast ThisDrawing.Regen True MsgBox "The Contrast is currently set to: " & raster.Contrast, vbInformation ' Change the Contrast to 5 raster.Contrast = 5 ThisDrawing.Regen True MsgBox "The Contrast is now set to: " & raster.Contrast, vbInformation End Sub
Comments? |
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.