]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/dc.mm
Initial move from C to C++. The functionality of the code should not have
[wxWidgets.git] / src / cocoa / dc.mm
index 44762feba26796a9f25d9e50ffa1e54cfcf268d7..c40f86acae00cbec0113e480857c795ca88904e1 100644 (file)
@@ -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<wxBitmap&>(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];