#include "wx/filefn.h"
#include "wx/wfstream.h"
-
-#if wxUSE_XPM
- #include "wx/xpmdecod.h"
-#endif
+#include "wx/xpmdecod.h"
// For memcpy
#include <string.h>
#endif // wxUSE_FILE/wxUSE_FFILE
#endif // HAS_FILE_STREAMS
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxImage
//-----------------------------------------------------------------------------
}
#endif // wxUSE_STREAMS
-wxImage::wxImage( const char** xpmData )
+wxImage::wxImage(const char* const* xpmData)
{
Create(xpmData);
}
-wxImage::wxImage( char** xpmData )
-{
- Create((const char**) xpmData);
-}
-
-bool wxImage::Create( const char** xpmData )
+bool wxImage::Create(const char* const* xpmData)
{
#if wxUSE_XPM
UnRef();
unsigned char *source_alpha = 0 ;
unsigned char *target_alpha = 0 ;
- if (M_IMGDATA->m_hasMask)
- {
- image.SetMaskColour( M_IMGDATA->m_maskRed,
- M_IMGDATA->m_maskGreen,
- M_IMGDATA->m_maskBlue );
- }
- else
+ if ( !M_IMGDATA->m_hasMask )
{
source_alpha = M_IMGDATA->m_alpha ;
if ( source_alpha )
}
}
+ // If the original image has a mask, apply the mask to the new image
+ if (M_IMGDATA->m_hasMask)
+ {
+ image.SetMaskColour( M_IMGDATA->m_maskRed,
+ M_IMGDATA->m_maskGreen,
+ M_IMGDATA->m_maskBlue );
+ }
+
// In case this is a cursor, make sure the hotspot is scaled accordingly:
if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) )
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,
return M_IMGDATA->m_data[pos+2];
}
-bool wxImage::Ok() const
+bool wxImage::IsOk() const
{
// image of 0 width or height can't be considered ok - at least because it
// causes crashes in ConvertToBitmap() if we don't catch it in time