ZoomWave Example for C++ 5.0 and later
ILEADRasterAnnotation * pRasterAnn = NULL;
void CDemo::OnCreateZoomView()
{
ILEADRasterIO
* pRasterIO = NULL;
ILEADRasterZoomView
* pZoomView;
HRESULT
hr = CoCreateInstance(
CLSID_LEADRasterZoomView,
NULL,
CLSCTX_ALL,
IID_ILEADRasterZoomView,
(void**)&pZoomView
);
hr = CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);
hr = CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&pRasterAnn
);
//L_KEY_DOCUMENT
represents the unlock support string
m_RasterView.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT,
L_KEY_DOCUMENT);
pRasterIO->Load(m_RasterView.GetRaster(), TEXT("c:\\Ann.tif"),
0, 0, 1);
m_RasterView.SetPaintSizeMode(PAINTSIZEMODE_FIT);
IDispatch
*pDispatch = NULL;
(m_RasterView.GetControlUnknown())->QueryInterface(IID_IDispatch,
(void**)&pDispatch);
if(pDispatch==NULL)
return
;
pRasterAnn->PutAnnParentRasterView(pDispatch);
pRasterAnn->AnnUserMode = ANN_USERMODE_RUN;
pRasterAnn->AnnEnableZoomView
= TRUE;
pRasterAnn->AnnLoad("c:\\Ann.tif",0);
pZoomView->SrcLeft
= 0;
pZoomView->SrcTop =
0;
pZoomView->SrcWidth
= 100*100;
pZoomView->SrcHeight
= 100*100;
pZoomView->DstTop =
100*100;
pZoomView->DstLeft
= 100*100;
pZoomView->DstWidth
= 200*100;
pZoomView->DstHeight
= 200*100;
pZoomView->BorderStyle
= ZOOM_VIEW_BORDERSTYLE_3D;
pZoomView->SrcBorderStyle = SOURCE_BORDERSTYLE_3D;
pZoomView->ZoomFactor = 200;
pZoomView->Enabled
= TRUE;
pZoomView->ForceDst = TRUE;
pZoomView->AnnContainer
= pRasterAnn->AnnContainer;
m_RasterView.CreateZoomView(pZoomView);
pZoomView->Release();
pRasterIO->Release();
}