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:
@@ -24,6 +24,7 @@ public:
|
||||
wxBitmap(const char* const* bits);
|
||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0);
|
||||
wxBitmap(const wxImage& image, const wxDC& dc);
|
||||
|
||||
// Convert from wxIcon / wxCursor
|
||||
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
|
||||
@@ -77,6 +78,9 @@ protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
void InitFromImage(const wxImage& image, int depth, double WXUNUSED(scale));
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user