// This function would be called before start the conversion process
LPOLESTR T2OLE(LPCTSTR lpt)
{
static OLECHAR lpw[512];
if(!lpt)
return NULL;
lpw[0] = L'\0';
MultiByteToWideChar(CP_ACP, 0, lpt, -1, lpw, 512);
return lpw;
}
void BeforeConversion(IltmmConvert* pConvert)
{
long lWnd = 0;
ltmmSizeMode lSizeMode;
long lVideoH, lVideoW, lWndLeft, lWndTop, lWndW, lWndH;
long lLimit;
VARIANT_BOOL vb;
BSTR bstrLog;
IltmmConvert_get_VideoWindowHandle (pConvert, &lWnd);
if (lWnd)
{
IltmmConvert_get_VideoWidth (pConvert, &lVideoW);
IltmmConvert_get_VideoHeight (pConvert, &lVideoH);
IltmmConvert_get_VideoWindowWidth (pConvert, &lWndW);
IltmmConvert_get_VideoWindowHeight (pConvert, &lWndH);
IltmmConvert_get_VideoWindowLeft (pConvert, &lWndLeft);
IltmmConvert_get_VideoWindowTop (pConvert, &lWndTop);
IltmmConvert_get_VideoWindowSizeMode (pConvert, &lSizeMode);
if (((lVideoW > lWndW) && (lVideoH > lWndH)) && (lSizeMode != ltmmFit))
IltmmConvert_put_VideoWindowSizeMode (pConvert, ltmmFit);
else if ((lVideoW < lWndW) && (lVideoH < lWndH))
IltmmConvert_put_VideoWindowSizeMode (pConvert, ltmmStretch);
IltmmConvert_SetVideoWindowPos (pConvert, lWndLeft, lWndTop, lWndW, lWndH);
}
IltmmConvert_put_EnableStillCapture (pConvert, VARIANT_TRUE);
IltmmConvert_get_StillCaptureLimit (pConvert, &lLimit);
if (lLimit <= 1000)
IltmmConvert_put_StillCaptureLimit (pConvert, 10000);
IltmmConvert_get_FullScreenMode (pConvert, &vb);
if (vb == VARIANT_TRUE)
{
// Just to show how to use put_FullScreenMode
IltmmConvert_ToggleFullScreenMode (pConvert);
// Use put_FullScreenMode(VARIANT_FALSE) to turn off the full screen mode
IltmmConvert_put_FullScreenMode (pConvert, VARIANT_FALSE);
}
bstrLog = SysAllocString((OLECHAR*)MAKE_MEDIA_PATH("convert.log"));
IltmmConvert_OpenLogFile (pConvert, bstrLog, ltmmLogFile_GeneralInfo);
SysFreeString(bstrLog);
}
// This function would be called after the conversion process is finished.
void EndConversion(IltmmConvert* pConvert)
{
IltmmConvert_CloseLogFile (pConvert);
}
// This function would be called to saves a snapshot from the running stream to a file
void IltmmConvert_get_EnableStillCapture_Example (IltmmConvert* pConvert)
{
static int i = 0;
VARIANT_BOOL vb;
IltmmConvert_get_EnableStillCapture (pConvert, &vb);
if (vb == VARIANT_TRUE)
{
WCHAR wszFileName[100];
wsprintf(wszFileName, MAKE_MEDIA_PATH("SnapShot%d.cmp"), i++);
IltmmConvert_SaveStillBitmap (pConvert, wszFileName, ltmmConvert_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.