クリップ境界のオン/オフを設定します。
サポートされているプラットフォーム: Windows のみ
VBA:
object.ClippingEnabled
タイプ: DgnUnderlay、DwfUnderlay、GeomapImage、PdfUnderlay、RasterImage、Wipeout
このプロパティが適用されるオブジェクト。
読み込み専用: いいえ
タイプ: ブール型
クリップ境界を使用すると、クリッピングされたイメージまたはアンダーレイを表示することができます。クリップ境界を非表示にして元のイメージまたはアンダーレイの境界を表示することもできます。クリップ境界を設定するには、ClipBoundary メソッドを使用してください。
VBA:
Sub Example_ClippingEnabled()
' This example adds a raster image in model space.
' It then clips the image based on a clip boundary,
' and toggles the display of the clipping.
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\2d Projected Polylines.jpg"
insertionPoint(0) = 5#: insertionPoint(1) = 5#: insertionPoint(2) = 0#
scalefactor = 2#
rotationAngle = 0
On Error Resume Next
' Creates a raster image in model space
Set rasterObj = ThisDrawing.ModelSpace.AddRaster(imageName, insertionPoint, scalefactor, rotationAngle)
If Err.Description = "Filer error" Then
MsgBox imageName & " could not be found."
Exit Sub
End If
ZoomAll
MsgBox "Clip the image?", , "ClipBoundary Example"
' Establish the clip boundary with an array of points
Dim clipPoints(0 To 9) As Double
clipPoints(0) = 6: clipPoints(1) = 6.75
clipPoints(2) = 7: clipPoints(3) = 6
clipPoints(4) = 6: clipPoints(5) = 5
clipPoints(6) = 5: clipPoints(7) = 6
clipPoints(8) = 6: clipPoints(9) = 6.75
' Clip the image
rasterObj.clipBoundary clipPoints
' Enable the display of the clip
rasterObj.ClippingEnabled = True
ThisDrawing.Regen acActiveViewport
MsgBox "Turn off the display of the clipped image.", , "ClippingEnabled Example"
' Disable the display of the clip
rasterObj.ClippingEnabled = False
ThisDrawing.Regen acActiveViewport
MsgBox "Display off.", , "ClippingEnabled Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_ClippingEnabled()
;; This example adds a raster image in model space.
;; It then clips the image based on a clip boundary.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; 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.
(setq insertionPoint (vlax-3d-point 5 5 0)
imageName ".\\Sample\\VBA\\2d Projected Polylines.jpg"
scalefactor 2
rotationAngle 0)
(if (/= (findfile ".\\Sample\\VBA\\2d Projected Polylines.jpg") nil)
(progn
;; Creates a raster image in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq rasterObj (vla-AddRaster modelSpace (findfile ".\\Sample\\VBA\\2d Projected Polylines.jpg") insertionPoint scalefactor rotationAngle))
(vla-ZoomAll acadObj)
(alert "Clip the image?")
;; Establish the clip boundary with an array of points
(setq clipPoints (vlax-make-safearray vlax-vbDouble '(0 . 9)))
(vlax-safearray-fill clipPoints '(6 6.75
7 6
6 5
5 6
6 6.75
)
)
;; Clip the image
(vla-ClipBoundary rasterObj clipPoints)
;; Enable the display of the clip
(vla-put-ClippingEnabled rasterObj :vlax-true)
(vla-Regen doc acActiveViewport)
(alert "Turn off the display of the clipped image.")
;; Disable the display of the clip
(vla-put-ClippingEnabled rasterObj :vlax-false)
(vla-Regen doc acActiveViewport)
(alert "Clip boundary off.")
)
(alert (strcat imageName " could not be found."))
)
)