Delimitaci髇 del contorno delimitador de una imagen r醩ter
From AutoCAD ActiveX
Este ejemplo crea una cota radial en espacio modelo. Después delimita la imagen basándose en un contorno delimitador. Este ejemplo utiliza el archivo downtown.jpg, que se encuentra en el directorio de ejemplos. Si no tiene esta imagen o si está situada en un directorio diferente, escriba una ruta y un nombre de archivo válidos para la variable imageName.
Sub Ch10_ClippingRasterBoundary()
Dim insertionPoint(0 To 2) As Double
Dim scalefactor As Double
Dim rotationAngle As Double
Dim dwgName As String
Dim rasterObj As AcadRasterImage
imageName = "C:\AutoCAD\sample\downtown.jpg"insertionPoint(0) = 5insertionPoint(1) = 5insertionPoint(2) = 0scalefactor = 2rotationAngle = 0On Error GoTo ERRORHANDLER' Creates a raster image in model spaceSet xlineObj = ThisDrawing.ModelSpace.AddXLine _(imageName, insertionPoint, _scalefactor, rotationAngle)ZoomAll' Establish the clip boundary with an array of pointsDim clipPoints(0 To 9) As DoubleclipPoints(0) = 6: clipPoints(1) = 6.75clipPoints(2) = 7: clipPoints(3) = 6clipPoints(4) = 6: clipPoints(5) = 5clipPoints(6) = 5: clipPoints(7) = 6clipPoints(8) = 6: clipPoints(9) = 6,75' Clip the imagerasterObj.ClipBoundary clipPoints' Enable the display of the cliprasterObj.ClippingEnabled = TrueThisDrawing.Regen acActiveViewportExit SubERRORHANDLER:MsgBox Err.DescriptionEnd Sub