int wxBitmap::GetHeight(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return -1;
- }
+ wxCHECK_MSG( Ok(), -1, "invalid bitmap" );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return -1;
- }
+ wxCHECK_MSG( Ok(), -1, "invalid bitmap" );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return -1;
- }
+ wxCHECK_MSG( Ok(), -1, "invalid bitmap" );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return (wxMask *) NULL;
- }
+ wxCHECK_MSG( Ok(), (wxMask *) NULL, "invalid bitmap" );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask( wxMask *mask )
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return;
- }
+ wxCHECK_RET( Ok(), "invalid bitmap" );
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) )
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return FALSE;
- }
+ wxCHECK_MSG( Ok(), FALSE, "invalid bitmap" );
if (type == wxBITMAP_TYPE_PNG)
{
wxPalette *wxBitmap::GetPalette(void) const
{
if (!Ok()) return (wxPalette *) NULL;
+
return M_BMPDATA->m_palette;
}
GdkPixmap *wxBitmap::GetPixmap(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return (GdkPixmap *) NULL;
- }
+ wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, "invalid bitmap" );
return M_BMPDATA->m_pixmap;
}
GdkBitmap *wxBitmap::GetBitmap(void) const
{
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return (GdkBitmap *) NULL;
- }
+ wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, "invalid bitmap" );
return M_BMPDATA->m_bitmap;
}
{
wxImage image;
- if (!Ok())
- {
- wxFAIL_MSG( "invalid bitmap" );
- return image;
- }
+ wxCHECK_MSG( Ok(), image, "invalid bitmap" );
GdkImage *gdk_image = gdk_image_get( M_BMPDATA->m_pixmap, 0, 0, M_BMPDATA->m_width, M_BMPDATA->m_height );