Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * X B M I m a g e O b j e c t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2003,2006 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXXBMImage.h,v 1.12 2006/01/22 17:58:12 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXXBMIMAGE_H 00025 #define FXXBMIMAGE_H 00026 00027 #ifndef FXIMAGE_H 00028 #include "FXImage.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 /// X Bitmap image 00035 class FXAPI FXXBMImage : public FXImage { 00036 FXDECLARE(FXXBMImage) 00037 protected: 00038 FXXBMImage(){} 00039 private: 00040 FXXBMImage(const FXXBMImage&); 00041 FXXBMImage &operator=(const FXXBMImage&); 00042 public: 00043 static const FXchar fileExt[]; 00044 static const FXchar mimeType[]; 00045 public: 00046 00047 /// Construct image from memory stream formatted in X Bitmap format 00048 FXXBMImage(FXApp* a,const FXuchar *pixels=NULL,const FXuchar *mask=NULL,FXuint opts=0,FXint w=1,FXint h=1); 00049 00050 /// Save pixels into stream in X Bitmap format 00051 virtual bool savePixels(FXStream& store) const; 00052 00053 /// Load pixels from stream in X Bitmap format 00054 virtual bool loadPixels(FXStream& store); 00055 00056 /// Destroy icon 00057 virtual ~FXXBMImage(); 00058 }; 00059 00060 00061 #ifndef FXLOADXBM 00062 #define FXLOADXBM 00063 00064 /** 00065 * Check if stream contains a XBM, return TRUE if so. 00066 */ 00067 extern FXAPI bool fxcheckXBM(FXStream& store); 00068 00069 /** 00070 * Load an XBM (X Bitmap) from pixel array and mask array. 00071 * Upon successful return, the pixel array and size are returned. 00072 * If an error occurred, the pixel array is set to NULL. 00073 */ 00074 extern FXAPI bool fxloadXBM(FXColor*& data,const FXuchar *pix,const FXuchar *msk,FXint width,FXint height); 00075 00076 00077 /** 00078 * Load an XBM (X Bitmap) file from a stream. 00079 * Upon successful return, the pixel array and size, and hot-spot are returned. 00080 * If an error occurred, the pixel array is set to NULL. 00081 */ 00082 extern FXAPI bool fxloadXBM(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& hotx,FXint& hoty); 00083 00084 00085 /** 00086 * Save an XBM (X Bitmap) file to a stream; if the parameters hotx and hoty are set 00087 * to -1, no hotspot location is saved. 00088 */ 00089 extern FXAPI bool fxsaveXBM(FXStream& store,const FXColor *data,FXint width,FXint height,FXint hotx=-1,FXint hoty=-1); 00090 00091 /** 00092 * Save a PostScript file to a stream; format the picture to the maximal 00093 * size that fits within the given margins of the indicated paper size. 00094 */ 00095 extern FXAPI bool fxsavePS(FXStream& store,const FXColor *data,FXint width,FXint height,FXint paperw=612,FXint paperh=792,FXint margin=35,bool color=true); 00096 00097 #endif 00098 00099 } 00100 00101 #endif
Copyright © 1997-2005 Jeroen van der Zijp |