Move scale factor-related functions to wxGDIImage from wxBitmap
This makes them available in wxIcon (and, less importantly, wxCursor) too which is needed in order to use icons correctly in high DPI. This is also more consistent with the other platforms, where wxIcon does have these methods. Document these methods in wxIcon now that they're available there under all platforms and also document wxIcon::GetSize() which had been available even before, but wasn't documented.
This commit is contained in:
@@ -118,10 +118,19 @@ public:
|
||||
int GetWidth() const { return IsNull() ? 0 : GetGDIImageData()->m_width; }
|
||||
int GetHeight() const { return IsNull() ? 0 : GetGDIImageData()->m_height; }
|
||||
int GetDepth() const { return IsNull() ? 0 : GetGDIImageData()->m_depth; }
|
||||
double GetScaleFactor() const
|
||||
{
|
||||
return IsNull() ? 1.0 : GetGDIImageData()->m_scaleFactor;
|
||||
}
|
||||
|
||||
// allow setting and storing the scale factor
|
||||
void SetScaleFactor(double scale);
|
||||
double GetScaleFactor() const;
|
||||
|
||||
// return the size divided by scale factor
|
||||
wxSize GetDIPSize() const;
|
||||
|
||||
// logical metrics accessors return the same thing as physical ones, just
|
||||
// as in all the other ports without wxHAS_DPI_INDEPENDENT_PIXELS.
|
||||
double GetLogicalWidth() const;
|
||||
double GetLogicalHeight() const;
|
||||
wxSize GetLogicalSize() const;
|
||||
|
||||
wxSize GetSize() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user