#include <prvwflt.h>
Inheritance diagram for PreviewFilterPNG:
Public Member Functions | |
PreviewFilterPNG () | |
Constructor for an PreviewFilterPNG object. The object should be initialised before use. | |
BOOL | Init () |
Initialise an PreviewFilter object. | |
virtual BOOL | DoExport (Operation *, CCLexFile *, PathName *, Document *, BOOL) |
Do some set up before exporting so the BaseBitmapFilter base class knows it is really a preview. The BaseBitmapFilter can then do resizing as necessary. | |
Protected Member Functions | |
virtual BOOL | GetExportOptions (BitmapExportOptions *pOptions) |
Override base class so we don't put up a dialog but still provide fixed options for preview bitmap filters. Notes: See BaseBitmapFilter for interface details. | |
Private Member Functions | |
CC_DECLARE_DYNAMIC (PreviewFilterPNG) |
Definition at line 246 of file prvwflt.h.
|
Constructor for an PreviewFilterPNG object. The object should be initialised before use. / /*!
Definition at line 773 of file prvwflt.cpp. 00773 : PNGFilter() 00774 { 00775 ImportMsgID = _R(IDS_IMPORTMSG_PNG); 00776 00777 // Set it up so that it can neither Import or Export so that it does not appear in the 00778 // Filter menus. 00779 Flags.CanImport = FALSE; 00780 Flags.CanExport = FALSE; 00781 FilterID = FILTERID_PNG; // FILTERID_PREVIEW_PNG; 00782 00783 ExportRegion = NULL; 00784 ExportMsgID = _R(IDS_BUILDINGPREVIEW); 00785 ExportingMsgID = _R(IDS_BUILDINGPREVIEW); 00786 }
|
|
|
|
Do some set up before exporting so the BaseBitmapFilter base class knows it is really a preview. The BaseBitmapFilter can then do resizing as necessary.
Reimplemented from BaseBitmapFilter. Reimplemented in ThumbnailFilterPNG. Definition at line 833 of file prvwflt.cpp. 00835 { 00836 INT32 OldPreviewSize = PreviewFilter::PreviewBitmapSize; 00837 // Set the Preview to be just over an inch accross 00838 PreviewFilter::PreviewBitmapSize = 96000; 00839 00840 // set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be 00841 // done there because of Accusoft. 00842 SetPreviewBitmap(TRUE); 00843 00844 // Export the Preview to the file by doing what our base class does 00845 BOOL ok = PNGFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE); 00846 00847 // Set ourselves back 00848 SetPreviewBitmap(FALSE); 00849 // Set the Preview back to its default setting 00850 PreviewFilter::PreviewBitmapSize = OldPreviewSize; 00851 00852 return ok; 00853 }
|
|
Override base class so we don't put up a dialog but still provide fixed options for preview bitmap filters. Notes: See BaseBitmapFilter for interface details.
Reimplemented from PNGFilter. Definition at line 867 of file prvwflt.cpp. 00868 { 00869 ERROR2IF(pOptions == NULL, FALSE, "NULL Args"); 00870 ERROR3IF(!pOptions->IS_KIND_OF(PNGExportOptions), "pOptions isn't a PNGExportOptions"); 00871 00872 PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions; 00873 00874 // the depth we ask GDraw to render is always 32-bit, so we can get transparency 00875 // we have to convert for other formats when writing the actual bytes to the file 00876 SetDepthToRender(32); 00877 00878 // We haven't written the header yet 00879 WrittenHeader = FALSE; 00880 00882 // BitmapExportOptions 00883 // 00884 00885 // this dpi will be used to scale the preview 00886 pPNGOptions->SetDPI(96.0); 00887 00888 // the export depth of the preview is always 8 00889 pPNGOptions->SetDepth(8); 00890 00891 // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97 00892 //PreviewDither = ?; 00893 PreviewPalette = PAL_OPTIMISED; 00894 00896 // MaskedFilterExportOptions 00897 // 00898 00899 pPNGOptions->SetDither( XARADITHER_NONE ); 00900 00901 // Previews have an optimized palette 00902 PaletteType = PreviewPalette; 00903 // pPNGOptions->SetPalette( (PALETTE)PreviewPalette ); 00904 00905 // Previews have no interlace/transparency 00906 // pPNGOptions->SetMakeTransparent( FALSE ); 00907 pPNGOptions->SetTransparencyIndex(-1); 00908 pPNGOptions->SetMakeInterlaced( FALSE ); 00909 00910 // We are a first pass render and not doing the mask, by default 00911 SecondPass = FALSE; 00912 DoingMask = FALSE; 00913 00914 // Default will range from 0 to 4 types which correspond to the combinations of 00915 // on/off interlaced and on/off transparent 00916 Compression = 0; // Previews have no interlace/transparency 00917 00918 // Determine the filter type currently in use in Accusoft format 00919 FilterID = FILTERID_PNG; 00920 pPNGOptions->SetFilterType(PNG); 00921 00922 return TRUE; 00923 }
|
|
Initialise an PreviewFilter object.
Reimplemented from PNGFilter. Definition at line 801 of file prvwflt.cpp. 00802 { 00803 // Get the OILFilter object 00804 pOILFilter = new PNGOILFilter(this); 00805 if (pOILFilter==NULL) 00806 return FALSE; 00807 00808 // Load the description strings 00809 FilterName.Load(_R(IDS_PNG_FILTERNAME)); 00810 FilterInfo.Load(_R(IDS_PNG_FILTERINFO)); 00811 00812 // All ok 00813 return TRUE; 00814 }
|