00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: plwemfdec.h,v 1.5 2003/08/03 12:03:22 uzadow Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 -------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_WEMFDEC_H 00012 #define INCL_WEMFDEC_H 00013 00014 #ifndef INCL_PLPICDEC 00015 #include "plpicdec.h" 00016 #endif 00017 00018 // This only makes sense for Windows 00019 #ifdef _WINDOWS 00020 00021 #if _MSC_VER > 1000 00022 #pragma once 00023 #endif // _MSC_VER > 1000 00024 00025 00026 //! Decoder for 16-Bit Windows Metafiles (*.wmf) and 16-Bit Adobe 00027 //! Placeable Metafiles (*,wmf) and 32-Bit Enhanced Windows 00028 //! Metafiles (*.emf) for Windows 95, Windows 98 and Windows NT 00029 //! >= 3.1. 00030 //! 00031 //! Comments by the author, Mario Westphal:<BR> 00032 //! <I>It can handle at least the 500 tested images I've got 00033 //! from various free and commercial clipart sources. If 00034 //! you find a WMF/EMF file it cannot handle, attach it to 00035 //! an email and send it to mw@mwlabs.de. I'll see what I 00036 //! can do. But, please, test it with another program 00037 //! before you send itin to see if it is really a valid 00038 //! metafile.</I> 00039 class PLWEMFDecoder : public PLPicDecoder 00040 { 00041 public: 00042 //! 00043 PLWEMFDecoder(); 00044 00045 //! 00046 virtual ~PLWEMFDecoder(); 00047 00048 //! Fills the PLBmpInfo fields. To do this, the routine reads the complete 00049 //! file. 00050 virtual void Open (PLDataSource * pDataSrc); 00051 00052 //! Fills the bitmap with the image. 00053 virtual void GetImage (PLBmp & Bmp); 00054 00055 //! 00056 void Close(); 00057 00058 #ifdef _DEBUG 00059 virtual void AssertValid() const; 00060 #endif 00061 00062 private: 00063 HENHMETAFILE m_hemf; 00064 HDC m_memdc; 00065 HDC m_dc; 00066 HBITMAP m_bm; 00067 HPALETTE m_holdpal; 00068 HGDIOBJ m_holdbm; 00069 LPENHMETAHEADER m_phdr; 00070 00071 }; 00072 00073 #endif // _WINDOWS 00074 00075 #endif // INCL_WEMFDEC_H 00076 00077 /* 00078 /-------------------------------------------------------------------- 00079 | 00080 | $Log: plwemfdec.h,v $ 00081 | Revision 1.5 2003/08/03 12:03:22 uzadow 00082 | Added unicode support; fixed some header includes. 00083 | 00084 | Revision 1.4 2002/08/04 20:08:01 uzadow 00085 | Added PLBmpInfo class, ability to extract metainformation from images without loading the whole image and proper greyscale support. 00086 | 00087 | Revision 1.3 2002/03/31 13:36:42 uzadow 00088 | Updated copyright. 00089 | 00090 | Revision 1.2 2001/10/21 17:12:40 uzadow 00091 | Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel. 00092 | 00093 | Revision 1.1 2001/09/16 19:03:23 uzadow 00094 | Added global name prefix PL, changed most filenames. 00095 | 00096 | Revision 1.5 2000/12/18 22:42:53 uzadow 00097 | Replaced RGBAPIXEL with PLPixel32. 00098 | 00099 | Revision 1.4 2000/01/16 20:43:18 anonymous 00100 | Removed MFC dependencies 00101 | 00102 | Revision 1.3 1999/12/02 17:07:35 Ulrich von Zadow 00103 | Changes by bdelmee. 00104 | 00105 | 00106 \-------------------------------------------------------------------- 00107 */