ShowPNGWebTunerDlg Example for C++ 5.0 and later
void CDialogs::OnPngWebTuner()
{
short nRet;
m_pRasterWebDlg->PutUIFlags(PNGWEBTUNER_SHOW_INFORMATION |
PNGWEBTUNER_SHOW_PREVIEW |
PNGWEBTUNER_SHOW_TOOL_ZOOMLEVEL |
PNGWEBTUNER_SHOW_TOOL_COLORPICKER |
PNGWEBTUNER_SHOW_TRANSPARENCY |
PNGWEBTUNER_SHOW_ADDWINDOWCOLOR
);
m_pRasterWebDlg->PutBitmap(m_RasterView.GetRaster().GetBitmap ());
m_pRasterWebDlg->PutTransparentColor(RGB ( 255, 255, 255 ));
m_pRasterWebDlg->PutPaletteType(CRP_FIXEDPALETTE);
m_pRasterWebDlg->PutEnableWindowsColors(TRUE);
m_pRasterWebDlg->PutDitherType(CRD_FLOYDSTEINDITHERING);
m_pRasterWebDlg->PutBitsPerPixel(8);
m_pRasterWebDlg->PutNumberOfColors(256);
m_pRasterWebDlg->PutTransparencyTolerance(25);
m_pRasterWebDlg->PutEnableTransparent(TRUE);
m_pRasterWebDlg->PutShowHelpButton(TRUE);
m_pRasterWebDlg->PutEnableZoomToFit(TRUE);
nRet = m_pRasterWebDlg->ShowPNGWebTunerDlg((long)this->m_hWnd);
if(nRet == 0 && m_pRasterWebDlg->GetDialogStatus() == OK)
{
m_pRasterProcess->ColorRes (m_RasterView.GetRaster (),
m_pRasterWebDlg->BitsPerPixel,
m_pRasterWebDlg->GetPaletteType(),
m_pRasterWebDlg->GetDitherType(),
0 );
}
}
void CRasterWebDlgSink::OnDlgHelp((long DlgFrom, long CtlID)
{
switch(DlgFrom)
{
case HELP_PNGWEBTUNER:
AfxMessageBox(TEXT("Help from PNG Web Tuner dialog "));
break;
case HELP_GIFWEBTUNER:
AfxMessageBox(TEXT("Help from GIF Web Tuner dialog "));
break;
case HELP_JPEGWEBTUNER:
AfxMessageBox(TEXT("Help from JPEG Web Tuner dialog "));
break;
case HELP_HTMLMAPPER:
AfxMessageBox(TEXT("Help from HTMLMapper dialog "));
break;
}
}