bool Create( char** xpmData ) { return Create(const_cast<const char* const*>(xpmData)); }
#endif
void Destroy();
+
+ // initialize the image data with zeroes
+ void Clear(unsigned char value = 0);
// creates an identical copy of the image (the = operator
// just raises the ref count)
@param height
The height of the image in pixels.
@param clear
- If @true, initialize the image data with zeros.
+ If @true, initialize the image data with zeroes.
@return @true if the call succeeded, @false otherwise.
*/
bool Create(int width, int height, bool clear = true);
+ /**
+ Initialize the image data with zeroes (the default) or with the
+ byte value given as @a value.
+
+ @since 2.9.0
+ */
+ void Clear(unsigned char value = 0);
+
/**
Destroys the image data.
*/
// what to test (in alphabetic order)? Define TEST_ALL to 0 to do a single
// test, define it to 1 to do all tests.
-#define TEST_ALL 1
+#define TEST_ALL 0
#if TEST_ALL
#define TEST_WCHAR
#define TEST_ZIP
#else // #if TEST_ALL
- #define TEST_EXECUTE
+ #define TEST_FTP
#endif
// some tests are interactive, define this to run them
#include "wx/protocol/ftp.h"
-static wxFTP ftp;
-
#define FTP_ANONYMOUS
#ifdef FTP_ANONYMOUS
return false;
}
- if (clear)
- memset(M_IMGDATA->m_data, 0, width*height*3);
-
M_IMGDATA->m_width = width;
M_IMGDATA->m_height = height;
M_IMGDATA->m_ok = true;
+ if (clear)
+ {
+ Clear();
+ }
+
return true;
}
UnRef();
}
+void wxImage::Clear(unsigned char value)
+{
+ memset(M_IMGDATA->m_data, value, M_IMGDATA->m_width*M_IMGDATA->m_height*3);
+}
+
wxObjectRefData* wxImage::CreateRefData() const
{
return new wxImageRefData;