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:
@@ -291,6 +291,8 @@ wxBitmapRefData::wxBitmapRefData(CGImageRef image)
|
|||||||
|
|
||||||
bool wxBitmapRefData::Create(CGImageRef image)
|
bool wxBitmapRefData::Create(CGImageRef image)
|
||||||
{
|
{
|
||||||
|
if ( image != NULL )
|
||||||
|
{
|
||||||
m_width = CGImageGetWidth(image);
|
m_width = CGImageGetWidth(image);
|
||||||
m_height = CGImageGetHeight(image);
|
m_height = CGImageGetHeight(image);
|
||||||
m_depth = 32;
|
m_depth = 32;
|
||||||
@@ -320,6 +322,7 @@ bool wxBitmapRefData::Create(CGImageRef image)
|
|||||||
CGContextTranslateCTM( m_hBitmap, 0, m_height );
|
CGContextTranslateCTM( m_hBitmap, 0, m_height );
|
||||||
CGContextScaleCTM( m_hBitmap, 1, -1 );
|
CGContextScaleCTM( m_hBitmap, 1, -1 );
|
||||||
} /* data != NULL */
|
} /* data != NULL */
|
||||||
|
}
|
||||||
m_ok = ( m_hBitmap != NULL ) ;
|
m_ok = ( m_hBitmap != NULL ) ;
|
||||||
|
|
||||||
return m_ok ;
|
return m_ok ;
|
||||||
|
Reference in New Issue
Block a user