ShowJPEGWebTunerDlg Example for C++ 5.0 and later

void CDialogs::OnJPEGWebTuner()
{
	HRESULT hr;
	int nRet;

	ILEADRasterDlgKrn_U *m_pRasterDlgKrn = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgKrn_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgKrn_U,
		(LPVOID*)&m_pRasterDlgKrn);

	ILEADRasterDlgWeb_U *m_pRasterDlgWeb = NULL;
	hr = CoCreateInstance(CLSID_LEADRasterDlgWeb_U,
		NULL,
		CLSCTX_ALL,
		IID_ILEADRasterDlgWeb_U,
		(LPVOID*)&m_pRasterDlgWeb);

	nRet = m_pRasterDlgKrn->InitDlg(INIT_WITH_COLOR);

	m_pRasterDlgWeb->Bitmap = m_pLead1.GetBitmap();
	m_pRasterDlgWeb->UIFlags = JPEGWEBTUNER_SHOW_INFORMATION |
		JPEGWEBTUNER_SHOW_PREVIEW |
		JPEGWEBTUNER_SHOW_TOOL_ZOOMLEVEL |
		JPEGWEBTUNER_SHOW_SAVETHUMBNAIL |
		JPEGWEBTUNER_SHOW_OPTIONS |
		JPEGWEBTUNER_SHOW_SAVETHUMBNAIL; 

	nRet = m_pRasterDlgWeb->ShowJPEGWebTunerDlg((long)m_hWnd); 
	if(nRet == 0 && m_pRasterDlgWeb->GetDialogStatus () == DLG_OK) 
	{
		if ( m_pRasterDlgWeb->GetEnableProgressive())
			m_pLead1.SetProgressivePasses(1); 

		if (m_pRasterDlgWeb->GetEnableStamp())
		{
			m_pLead1.SaveWithStamp(TEXT("C:\\output.jpg"),
				m_pRasterDlgWeb->GetJPEGFormat(),
				24, 
				m_pRasterDlgWeb->GetQuality(),
				32, 
				32, 
				24); 
		}
		else
		{
			m_pLead1.Save(TEXT("C:\\Temp\\Output.jpg"),
				m_pRasterDlgWeb->GetJPEGFormat(),
				24, 
				m_pRasterDlgWeb->GetQuality(),
				SAVE_OVERWRITE); 
		}
	}
}