add wxImage::Clear (patch by troelsk); closes #10141

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-09 15:35:59 +00:00
parent ecba92ec08
commit fc3762b5fc
4 changed files with 24 additions and 8 deletions

View File

@@ -195,13 +195,15 @@ bool wxImage::Create( int width, int height, bool clear )
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;
}
@@ -246,6 +248,11 @@ void wxImage::Destroy()
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;