Add wxBitmap(wxImage, wxDC) ctor to all ports

This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.

In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.

Enable previously wxMSW-only unit test checking for this.
This commit is contained in:
Vadim Zeitlin
2022-04-12 17:44:59 +01:00
parent b185186ebf
commit 24970061fa
12 changed files with 74 additions and 17 deletions

View File

@@ -69,6 +69,7 @@ public:
wxBitmap( const char* const* bits );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE );
wxBitmap( const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0 ) { (void)CreateFromImage(image, depth); }
wxBitmap( const wxImage& image, const wxDC& WXUNUSED(dc) ) { (void)CreateFromImage(image); }
explicit wxBitmap(const wxCursor& cursor);
virtual ~wxBitmap();