- LockPixels(GetGWorldPixMap( (GWorldPtr) GetHBITMAP()));
- SetGWorld( (GWorldPtr) GetHBITMAP(), NULL);
-
+ if ( GetBitmapType() != kMacBitmapTypeGrafWorld )
+ {
+ tempPort = wxMacCreateGWorld( width , height , -1) ;
+ }
+ else
+ {
+ tempPort = (GWorldPtr) GetHBITMAP() ;
+ }
+ LockPixels(GetGWorldPixMap(tempPort));
+ SetGWorld( tempPort, NULL);
+ if ( GetBitmapType() == kMacBitmapTypePict || GetBitmapType() == kMacBitmapTypeIcon )
+ {
+ Rect bitmaprect = { 0 , 0 , height, width };
+ if ( GetBitmapType() == kMacBitmapTypeIcon )
+ {
+ ::PlotCIconHandle( &bitmaprect , atNone , ttNone , MAC_WXHICON(GetHICON()) ) ;
+ maskRgn = NewRgn() ;
+ BitMapToRegion( maskRgn , &(**(MAC_WXHICON(GetHICON()))).iconMask ) ;
+ }
+ else
+ ::DrawPicture( (PicHandle) GetPict(), &bitmaprect ) ;
+ }