backport brackting 10.5 only code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@61301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -299,14 +299,21 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const
|
|||||||
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain];
|
NSBitmapImageRep *rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect: [view bounds]] retain];
|
||||||
[view unlockFocus];
|
[view unlockFocus];
|
||||||
|
|
||||||
|
wxBitmap bitmap(width, height);
|
||||||
|
if ( [rep respondsToSelector:@selector(CGImage)] )
|
||||||
|
{
|
||||||
CGImageRef cgImageRef = (CGImageRef)[rep CGImage];
|
CGImageRef cgImageRef = (CGImageRef)[rep CGImage];
|
||||||
|
|
||||||
wxBitmap bitmap(CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) );
|
|
||||||
CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) );
|
CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) );
|
||||||
// since our context is upside down we dont use CGContextDrawImage
|
// since our context is upside down we dont use CGContextDrawImage
|
||||||
wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ;
|
wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ;
|
||||||
CGImageRelease(cgImageRef);
|
CGImageRelease(cgImageRef);
|
||||||
cgImageRef = NULL;
|
cgImageRef = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO for 10.4 in case we can support this for osx_cocoa
|
||||||
|
}
|
||||||
[rep release];
|
[rep release];
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
|
Reference in New Issue
Block a user