supporting a null cgimage so that we don't get exceptions, only an wxbitmap that is !Ok()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2011-01-25 18:47:12 +00:00
parent 5769f801b4
commit 554b2800c6

View File

@@ -290,6 +290,8 @@ wxBitmapRefData::wxBitmapRefData(CGImageRef image)
// code from Technical Q&A QA1509
bool wxBitmapRefData::Create(CGImageRef image)
{
if ( image != NULL )
{
m_width = CGImageGetWidth(image);
m_height = CGImageGetHeight(image);
@@ -320,6 +322,7 @@ bool wxBitmapRefData::Create(CGImageRef image)
CGContextTranslateCTM( m_hBitmap, 0, m_height );
CGContextScaleCTM( m_hBitmap, 1, -1 );
} /* data != NULL */
}
m_ok = ( m_hBitmap != NULL ) ;
return m_ok ;