From a00daa65ec8e09e8091048e0155c250c6d534942 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Mon, 15 Dec 2003 21:07:44 +0000 Subject: [PATCH] Use wxBitmap::GetNSImage() in wxDC::DrawBitmap. Mask support now works. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/dc.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index 44762feba2..c40f86acae 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -481,12 +481,11 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) [transform concat]; [flipTransform concat]; - NSImage *nsimage = [[NSImage alloc] - initWithSize:NSMakeSize(bmp.GetWidth(), bmp.GetHeight())]; - [nsimage addRepresentation: const_cast(bmp).GetNSBitmapImageRep()]; + NSImage *nsimage = [bmp.GetNSImage(useMask) retain]; + [nsimage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(0.0,0.0,bmp.GetWidth(),bmp.GetHeight()) - operation: NSCompositeCopy + operation: NSCompositeSourceOver fraction: 1.0]; [nsimage release]; -- 2.50.0