请参考下面的代码,主要是用RectFromContainerCoordinates这个方法对坐标进行了转换,
- LeadRectD rectd = ActiveAnnotationsForm.Automation.Container.Children[0].Bounds;
- LeadRect rect = ActiveAnnotationsForm.Automation.Container.Mapper.RectFromContainerCoordinates(rectd,AnnFixedStateOperations.None).ToLeadRect();
- ActiveAnnotationsForm.Viewer.Image.AddRectangleToRegion(null, rect, RasterRegionCombineMode.Set);
复制代码 |