Added XPM ctor

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-02-28 11:00:07 +00:00
parent 284be59b10
commit cad61c3e8f
2 changed files with 30 additions and 0 deletions

View File

@@ -35,6 +35,10 @@
#include "wx/utils.h"
#include "wx/math.h"
#if wxUSE_XPM
#include "wx/xpmdecod.h"
#endif
// For memcpy
#include <string.h>
@@ -159,6 +163,29 @@ wxImage::wxImage( const wxImage* image )
if (image) Ref(*image);
}
wxImage::wxImage( const char** xpmData )
{
Create(xpmData);
}
wxImage::wxImage( char** xpmData )
{
Create((const char**) xpmData);
}
bool wxImage::Create( const char** xpmData )
{
#if wxUSE_XPM
UnRef();
wxXPMDecoder decoder;
(*this) = decoder.ReadData(xpmData);
return Ok();
#else
return false;
#endif
}
bool wxImage::Create( int width, int height, bool clear )
{
UnRef();