1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Routines for loading and saving DIBs
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 class WXDLLEXPORT wxBitmap
;
16 class WXDLLEXPORT wxPalette
;
18 // WARNING: these functions are private to wxWindows and shouldn't be used
19 // by the user code, they risk to disappear in the next versions!
21 // ----------------------------------------------------------------------------
22 // Functions for working with DIBs
23 // ----------------------------------------------------------------------------
25 // VZ: we have 3 different sets of functions: from bitmap.cpp (wxCreateDIB and
26 // wxFreeDIB), from dib.cpp and from dataobj.cpp - surely there is some
27 // redundancy between them? (FIXME)
29 // defined in bitmap.cpp
30 extern bool wxCreateDIB(long xSize
, long ySize
, long bitsPerPixel
,
31 HPALETTE hPal
, LPBITMAPINFO
* lpDIBHeader
);
32 extern void wxFreeDIB(LPBITMAPINFO lpDIBHeader
);
34 // defined in ole/dataobj.cpp
35 extern WXDLLEXPORT
size_t wxConvertBitmapToDIB(LPBITMAPINFO pbi
, const wxBitmap
& bitmap
);
36 extern WXDLLEXPORT wxBitmap
wxConvertDIBToBitmap(const LPBITMAPINFO pbi
);
38 // the rest is defined in dib.cpp
40 // Save (device dependent) wxBitmap as a DIB
41 bool wxSaveBitmap(wxChar
*filename
, wxBitmap
*bitmap
, wxPalette
*colourmap
= NULL
);
43 // Load device independent bitmap into device dependent bitmap
44 wxBitmap
*wxLoadBitmap(wxChar
*filename
, wxPalette
**colourmap
= NULL
);
46 // Load into existing bitmap;
47 bool wxLoadIntoBitmap(wxChar
*filename
, wxBitmap
*bitmap
, wxPalette
**pal
= NULL
);
49 HANDLE
wxBitmapToDIB (HBITMAP hBitmap
, HPALETTE hPal
);
50 BOOL
wxReadDIB(LPTSTR lpFileName
, HBITMAP
*bitmap
, HPALETTE
*palette
);
51 HANDLE
wxReadDIB2(LPTSTR lpFileName
);
52 LPSTR
wxFindDIBBits (LPSTR lpbi
);
53 HPALETTE
wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo
);