#define MAKE_MEDIA_PATH(pFileName) (TEXT("C:\\LEADTOOLS\\Media\\")TEXT(pFileName))
// This function would be called before start the conversion process
void BeforeConversion(IltmfConvert *pConvert)
{
long lWnd = 0;
ltmfSizeMode lSizeMode;
long lLimit, lVideoH, lVideoW, lWndLeft, lWndTop, lWndW, lWndH;
VARIANT_BOOL vb;
BSTR bstrLog;
pConvert->get_VideoWindowHandle(&lWnd);
if (lWnd)
{
// get video dimensions
pConvert->get_VideoWidth(&lVideoW);
pConvert->get_VideoHeight(&lVideoH);
// get window size and pos
pConvert->get_VideoWindowWidth(&lWndW);
pConvert->get_VideoWindowHeight(&lWndH);
pConvert->get_VideoWindowLeft(&lWndLeft);
pConvert->get_VideoWindowTop(&lWndTop);
// set the desired video window size mode
pConvert->get_VideoWindowSizeMode(&lSizeMode);
if (lSizeMode != ltmfFit && lVideoW > lWndW && lVideoH > lWndH)
pConvert->put_VideoWindowSizeMode(ltmfFit);
else if (lVideoW < lWndW && lVideoH < lWndH)
pConvert->put_VideoWindowSizeMode(ltmfStretch);
}
// get full screen mode
pConvert->get_FullScreenMode(&vb);
if (vb == VARIANT_TRUE)
{
// Just to show how to use put_FullScreenMode
pConvert->ToggleFullScreenMode();
// Use put_FullScreenMode(VARIANT_FALSE) to turn off the full screen mode
pConvert->put_FullScreenMode(VARIANT_FALSE);
}
}
// This function would be called to save a snapshot from the running conversion to a file
void TakeSnapShots(IltmfConvert *pConvert)
{
static int i = 0;
WCHAR szFileName[100];
wsprintf(szFileName, MAKE_MEDIA_PATH("SnapShot%d.cmp"), i++);
USES_CONVERSION;
BSTR bstFileName = SysAllocString(szFileName);
pConvert->SaveStillBitmap(bstFileName, ltmfConvert_StillFormat_CMP, 2, 0, -1);
}
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.