Implement wxImageDataObject

Using this object we can put an wxImage on or retrieve it from the clipboard. wxImage is stored internally as a blob with either a PNG file (wxMSW, wxGTK) or a TIFF file (wxOSX) and therefore some its metadata (like resolution) is stored on the clipboard too (what is not the case for wxBitmap stored with wxBitmapDataObject). wxImages stored with wxImageDataObject can be used by native applications.

Closes #17631.
This commit is contained in:
Artur Wieczorek
2020-12-30 10:04:48 +01:00
parent a27a7656ea
commit e09c35efb5
3 changed files with 111 additions and 2 deletions

View File

@@ -36,7 +36,9 @@
wxTextDataObject | wxBitmapDataObject
|
wxCustomDataObject
|
|
wxImageDataObject
*/
// ============================================================================
@@ -545,6 +547,22 @@ private:
wxDECLARE_NO_COPY_CLASS(wxCustomDataObject);
};
// ----------------------------------------------------------------------------
// wxImageDataObject - data object for wxImage
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxImageDataObject : public wxCustomDataObject
{
public:
explicit wxImageDataObject(const wxImage& image = wxNullImage);
void SetImage(const wxImage& image);
wxImage GetImage() const;
private:
wxDECLARE_NO_COPY_CLASS(wxImageDataObject);
};
// ----------------------------------------------------------------------------
// include platform-specific declarations of wxXXXBase classes
// ----------------------------------------------------------------------------