- if (m_selected.Ok())
- {
- if (width) (*width) = m_selected.GetWidth();
- if (height) (*height) = m_selected.GetHeight();
- }
- else
- {
- if (width) (*width) = 0;
- if (height) (*height) = 0;
- };
-};
+ if ( m_selected.Ok() )
+ {
+ m_selected.EndRawAccess() ;
+ delete m_graphicContext ;
+ m_graphicContext = NULL ;
+ }
+
+ m_selected = bitmap;
+ if (m_selected.Ok())
+ {
+ if ( m_selected.GetDepth() != 1 )
+ m_selected.UseAlpha() ;
+ m_selected.BeginRawAccess() ;
+ m_width = bitmap.GetWidth();
+ m_height = bitmap.GetHeight();
+ CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace();
+ CGContextRef bmCtx = (CGContextRef) m_selected.GetHBITMAP();