LoadUseViewPerspective example for C++ 5.0 and later
Note: This topic is for Document/Medical
only.
This example times the loading of a bitmap with and without changing the
internal view perspective.
// Declare local variables.
CTime StartTime, EndTime;
CTimeSpan DeltaTime;
ILEADRasterIO *pRasterIO=NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
// Do not include paints when measuring time.
m_LEADRasterView1.SetAutoRepaint(FALSE);
// Time the load using the bitmap's view perspective.
pRasterIO->PutLoadUseViewPerspective(TRUE);
StartTime = CTime::GetCurrentTime();
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\o3.tif",
0, 0, 1);
EndTime = CTime::GetCurrentTime();
DeltaTime = EndTime - StartTime;
MessageBox (DeltaTime.Format(TEXT("%S seconds loaded as is") ), TEXT("Notice"), MB_OK);
// Time the load that converts the bitmap's view perspective.
pRasterIO->PutLoadUseViewPerspective(FALSE);
StartTime = CTime::GetCurrentTime();
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
"v:\\images\\o3.tif",
0, 0, 1);
EndTime = CTime::GetCurrentTime();
DeltaTime = EndTime - StartTime;
MessageBox (DeltaTime.Format(TEXT("%S seconds converted on load") ), TEXT("Notice"), MB_OK);
pRasterIO->Release();