1. new wxList code
2. fixes to allow compilation at -W4 with VisualC++ 6.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -739,35 +739,35 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
|
||||
bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
|
||||
{
|
||||
#if wxUSE_XPM_IN_MSW
|
||||
HDC dc = NULL;
|
||||
|
||||
Visual *visual = NULL;
|
||||
XImage ximage;
|
||||
|
||||
dc = CreateCompatibleDC(NULL);
|
||||
if (dc)
|
||||
{
|
||||
HDC dc = NULL;
|
||||
|
||||
XImage ximage;
|
||||
|
||||
dc = CreateCompatibleDC(NULL);
|
||||
if (dc)
|
||||
{
|
||||
if (SelectObject(dc, (HBITMAP) M_BITMAPHANDLERDATA->m_hBitmap))
|
||||
{ /* for following SetPixel */
|
||||
/* fill the XImage struct 'by hand' */
|
||||
ximage.width = M_BITMAPHANDLERDATA->m_width;
|
||||
ximage.height = M_BITMAPHANDLERDATA->m_height;
|
||||
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
|
||||
ximage.bitmap = (void *)M_BITMAPHANDLERDATA->m_hBitmap;
|
||||
int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
|
||||
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
|
||||
|
||||
if (dc)
|
||||
DeleteDC(dc);
|
||||
|
||||
if (errorStatus == XpmSuccess)
|
||||
return TRUE; /* no error */
|
||||
else
|
||||
return FALSE;
|
||||
{
|
||||
/* for following SetPixel */
|
||||
/* fill the XImage struct 'by hand' */
|
||||
ximage.width = M_BITMAPHANDLERDATA->m_width;
|
||||
ximage.height = M_BITMAPHANDLERDATA->m_height;
|
||||
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
|
||||
ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
|
||||
int errorStatus = XpmWriteFileFromImage(&dc, WXSTRINGCAST name,
|
||||
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
|
||||
|
||||
if (dc)
|
||||
DeleteDC(dc);
|
||||
|
||||
if (errorStatus == XpmSuccess)
|
||||
return TRUE; /* no error */
|
||||
else
|
||||
return FALSE;
|
||||
} else return FALSE;
|
||||
} else return FALSE;
|
||||
} else return FALSE;
|
||||
#else
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user