AO中用点选的方式选择点、线、面等(part3)
不好意思,上次发的这部分,应该还有下面这一个函数,有的朋友提出来这个函数没有定义,现在给出。呵呵,希望大家不要太责备我
double ConvertPixelToMapUnits(IActiveViewPtr pActiveView , double pixelUnits)
{
double realWorldDisplayExtent;
int pixelExtent;
double sizeOfOnePixel;
IScreenDisplayPtr ipScreenDisp;
IDisplayTransformationPtr ipDispTrf;
tagRECT trect;
IEnvelopePtr Visiblebound;
pActiveView->get_ScreenDisplay(&ipScreenDisp);
ipScreenDisp->get_DisplayTransformation(&ipDispTrf);
ipDispTrf->get_DeviceFrame(&trect);
pixelExtent=trect.right - trect.left;
ipDispTrf->get_VisibleBounds(&Visiblebound);
Visiblebound->get_Width(&realWorldDisplayExtent);
sizeOfOnePixel=realWorldDisplayExtent/pixelExtent;
return pixelUnits * sizeOfOnePixel;
{
double realWorldDisplayExtent;
int pixelExtent;
double sizeOfOnePixel;
IScreenDisplayPtr ipScreenDisp;
IDisplayTransformationPtr ipDispTrf;
tagRECT trect;
IEnvelopePtr Visiblebound;
pActiveView->get_ScreenDisplay(&ipScreenDisp);
ipScreenDisp->get_DisplayTransformation(&ipDispTrf);
ipDispTrf->get_DeviceFrame(&trect);
pixelExtent=trect.right - trect.left;
ipDispTrf->get_VisibleBounds(&Visiblebound);
Visiblebound->get_Width(&realWorldDisplayExtent);
sizeOfOnePixel=realWorldDisplayExtent/pixelExtent;
return pixelUnits * sizeOfOnePixel;
}
