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:
@@ -114,6 +114,7 @@ public:
|
||||
|
||||
// Convert from wxImage:
|
||||
wxBitmap(const wxImage& image, int depth = -1, double scale = 1.0);
|
||||
wxBitmap(const wxImage& image, const wxDC& dc);
|
||||
|
||||
// Convert from wxIcon
|
||||
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
|
||||
@@ -236,6 +237,9 @@ protected:
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE;
|
||||
|
||||
virtual bool DoCreate(const wxSize& sz, double scale, int depth) wxOVERRIDE;
|
||||
|
||||
private:
|
||||
void InitFromImage(const wxImage& image, int depth, double scale);
|
||||
};
|
||||
|
||||
#endif // _WX_BITMAP_H_
|
||||
|
||||
Reference in New Issue
Block a user