指定光栅或参考底图图像的当前淡入淡出值。 支持的平台:仅窗口 签名工 务 局: object.Fade
属性值只读:不 类型:长 该值介于 0 和 100 之间(含 0 和 100)。 言论您可以调整光栅或参考底图图像的亮度、对比度和淡入淡出以显示图像以及打印的输出,而不会影响原始栅格或参考底图文件。调整亮度以使图像变暗或变亮。调整对比度以使质量差的图像更易于阅读。调整淡入淡出以使矢量更易于在图像上看到,并在打印的输出中创建水印效果。 注意:黑白图像无法针对亮度、对比度或淡入淡出进行调整。
例子工 务 局: Sub Example_Fade() ' This example inserts a raster image and finds the current ' Fade value of the image. It then changes the Fade value ' of the image. ' This example uses the "2d Projected Polylines.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\2d Projected Polylines.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 = "Filer error" Then MsgBox imageName & " could not be found." Exit Sub End If ' Find the current Fade ThisDrawing.Regen True MsgBox "The Fade is currently set to: " & raster.Fade, vbInformation ' Change the Fade to 5 raster.Fade = 50 ThisDrawing.Regen True MsgBox "The Fade is now set to: " & raster.Fade, vbInformation End Sub Visual LISP: (vl-load-com) (defun c:Example_Fade() ;; This example inserts a raster image and finds the current ;; Fade value of the image. It then changes the Fade value ;; of the image. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; This example uses the "2d Projected Polylines.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. (setq insertionPoint (vlax-3d-point 2 2 0) imageName ".\\Sample\\VBA\\2d Projected Polylines.jpg" scalefactor 1 rotAngle (/ (* 0 3.141592) 180)) (if (/= (findfile imageName) nil) (progn ;; Creates a raster image in model space (setq modelSpace (vla-get-ModelSpace doc)) (setq raster (vla-AddRaster modelSpace (findfile imageName) insertionPoint scalefactor rotAngle)) (vla-ZoomExtents acadObj) ;; Find the current Fade (vla-Regen doc :vlax-true) (alert (strcat "The Fade is currently set to: " (rtos (vla-get-Fade raster) 2))) ;; Change the Fade to 5 (vla-put-Fade raster 5) (vla-Regen doc :vlax-true) (alert (strcat "The Fade is now set to: " (rtos (vla-get-Fade raster) 2))) ) (alert (strcat imageName " could not be found.")) ) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:25
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.