// This function would be called before start the conversion processvoid BeforeConversion(IltmmConvert *pConvert){long lWnd = 0;ltmmSizeMode lSizeMode;long lLimit, lVideoH, lVideoW, lWndLeft, lWndTop, lWndW, lWndH;VARIANT_BOOL vb;BSTR bstrLog;pConvert->get_VideoWindowHandle(&lWnd);if (lWnd){// get video dimensionspConvert->get_VideoWidth(&lVideoW);pConvert->get_VideoHeight(&lVideoH);// get window size and pospConvert->get_VideoWindowWidth(&lWndW);pConvert->get_VideoWindowHeight(&lWndH);pConvert->get_VideoWindowLeft(&lWndLeft);pConvert->get_VideoWindowTop(&lWndTop);// set the desired video window size modepConvert->get_VideoWindowSizeMode(&lSizeMode);if (lSizeMode != ltmmFit && lVideoW > lWndW && lVideoH > lWndH)pConvert->put_VideoWindowSizeMode(ltmmFit);else if (lVideoW < lWndW && lVideoH < lWndH)pConvert->put_VideoWindowSizeMode(ltmmStretch);// we could change the window size and position herepConvert->SetVideoWindowPos(lWndLeft, lWndTop, lWndW, lWndH);}// enable still capturepConvert->put_EnableStillCapture(VARIANT_TRUE);pConvert->get_StillCaptureLimit(&lLimit);// set the limit if less than 1 secif (lLimit <= 1000)pConvert->put_StillCaptureLimit(1000);// get full screen modepConvert->get_FullScreenMode(&vb);if (vb == VARIANT_TRUE){// Just to show how to use put_FullScreenModepConvert->ToggleFullScreenMode();// Use put_FullScreenMode(VARIANT_FALSE) to turn off the full screen modepConvert->put_FullScreenMode(VARIANT_FALSE);}// start loggingbstrLog = SysAllocString(MAKE_MEDIA_PATH("convert.log"));pConvert->OpenLogFile(bstrLog, ltmmLogFile_GeneralInfo);SysFreeString(bstrLog);}// This function would be called to save a snapshot from the running conversion to a filevoid TakeSnapShots(IltmmConvert *pConvert){static int i = 0;VARIANT_BOOL vb;pConvert->get_EnableStillCapture(&vb);if (vb == VARIANT_TRUE){WCHAR szFileName[100];wsprintf(szFileName, MAKE_MEDIA_PATH("SnapShot%d.cmp"), i++);USES_CONVERSION;BSTR bstFileName = SysAllocString(szFileName);pConvert->SaveStillBitmap(bstFileName, ltmmConvert_StillFormat_CMP, 2, 0, -1);}}// This function would be called after the conversion process is finished.void EndConversion(IltmmConvert *pConvert){pConvert->CloseLogFile();}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
