From 68d5ce9099ab7e39e30de519f97ac783e3ea6480 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 15 Jun 2013 16:29:04 +0000 Subject: [PATCH] adding new constructor for best dc-compatibility of bitmaps git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/bitmap.h | 3 +++ src/osx/core/bitmap.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/wx/osx/bitmap.h b/include/wx/osx/bitmap.h index eba46c6a1c..736e325376 100644 --- a/include/wx/osx/bitmap.h +++ b/include/wx/osx/bitmap.h @@ -107,6 +107,9 @@ public: wxBitmap(CGImageRef image); wxBitmap(WX_NSImage image); + // Create a bitmap compatible with the given DC + wxBitmap(int width, int height, const wxDC& dc); + // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); } wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); } diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 22efcde42a..da236465dd 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -939,6 +939,11 @@ wxBitmap::wxBitmap(const void* data, wxBitmapType type, int width, int height, i (void) Create(data, type, width, height, depth); } +wxBitmap::wxBitmap(int width, int height, const wxDC& WXUNUSED(dc)) +{ + (void) Create(width, height); +} + wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) { LoadFile(filename, type); @@ -1113,7 +1118,6 @@ bool wxBitmap::Create(int w, int h, int d) return M_BITMAPDATA->IsOk() ; } - bool wxBitmap::Create(CGImageRef image) { UnRef(); -- 2.45.2