BOOL PreviewFilterPNG::GetExportOptions(BitmapExportOptions* pOptions) { ERROR2IF(pOptions == NULL, FALSE, "NULL Args"); ERROR3IF(!pOptions->IS_KIND_OF(PNGExportOptions), "pOptions isn't a PNGExportOptions"); PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions; // the depth we ask GDraw to render is always 32-bit, so we can get transparency // we have to convert for other formats when writing the actual bytes to the file SetDepthToRender(32); // We haven't written the header yet WrittenHeader = FALSE; ///////////////////////////////////////////////////////////////////////// // BitmapExportOptions // // this dpi will be used to scale the preview pPNGOptions->SetDPI(96.0); // the export depth of the preview is always 8 pPNGOptions->SetDepth(8); // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97 //PreviewDither = ?; PreviewPalette = PAL_OPTIMISED; ///////////////////////////////////////////////////////////////////////// // MaskedFilterExportOptions // pPNGOptions->SetDither( XARADITHER_NONE ); // Previews have an optimized palette PaletteType = PreviewPalette; // pPNGOptions->SetPalette( (PALETTE)PreviewPalette ); // Previews have no interlace/transparency // pPNGOptions->SetMakeTransparent( FALSE ); pPNGOptions->SetTransparencyIndex(-1); pPNGOptions->SetMakeInterlaced( FALSE ); // We are a first pass render and not doing the mask, by default SecondPass = FALSE; DoingMask = FALSE; // Default will range from 0 to 4 types which correspond to the combinations of // on/off interlaced and on/off transparent Compression = 0; // Previews have no interlace/transparency // Determine the filter type currently in use in Accusoft format FilterID = FILTERID_PNG; pPNGOptions->SetFilterType(PNG); return TRUE; }
/******************************************************************************************** > virtual BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions) Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 12/11/96 Purpose: See BaseBitmapFilter for interface details ********************************************************************************************/ BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions) { ERROR2IF(pOptions == NULL, FALSE, "NULL Args"); PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions; ERROR3IF(!pPNGOptions->IS_KIND_OF(PNGExportOptions), "pPNGOptions isn't"); // the depth we ask GDraw to render is always 32-bit, so we can get transparency // we have to convert for other formats when writing the actual bytes to the file SetDepthToRender(32); // We haven't written the header yet WrittenHeader = FALSE; // We are a first pass render and not doing the mask, by default SecondPass = FALSE; DoingMask = FALSE; // Determine the filter type currently in use in Accusoft format s_FilterType = PNG; pPNGOptions->SetFilterType(PNG); BOOL Ok = FALSE; OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG); if (pOpDes != NULL) { // set up the data for the export options dialog OpParam Param((void *)pOptions, (void *)this); // invoke the dialog pOpDes->Invoke(&Param); // SMFIX // we have brought the dlg up so get the options from the dlg as the graphic type may have changed pOptions = BmapPrevDlg::m_pExportOptions; // check for valid options // This may get messed up, so have to use the second line below. Ok = BmapPrevDlg::m_bClickedOnExport; } else { ERROR3("Unable to find OPTOKEN_BMAPPREVDLG"); } // Return with the ok/cancel state used on the dialog box return Ok; }