VBA 切割影像

Polygon Example

' Create the RasterExtractionOp object
Dim pExtractionOp As IExtractionOp
Set pExtractionOp = New RasterExtractionOp

' Declare the input dataset object
Dim pInputDataset As IGeoDataset

' Call function to open a dataset
Set pInputDataset = OpenRasterDataset  ("D:\Spatialdata", "inputdata")

' Declare a polygon object
Dim pPolygon As IPolygon

' Call function to get a selected polygon from graphics  layer
Set pPolygon = GetSelectedPolygonFromLayer()

' Declare the output dataset
Dim pOutputDataset As IGeoDataset

' Call the method
Set pOutputDataset = pExtractionOp.Polygon  (pInputDataset, pPolygon, True)
原文地址:https://www.cnblogs.com/zhangjun1130/p/1864485.html