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:
@@ -35,7 +35,8 @@
|
||||
@itemdef{wxDF_HTML,
|
||||
An HTML string. This is currently only valid on Mac and MSW.}
|
||||
@itemdef{wxDF_PNG,
|
||||
A PNG file. This is valid only on MSW.}
|
||||
A PNG file. This is valid only on MSW. This constant is available
|
||||
since wxWidgets 3.1.5.}
|
||||
@endDefList
|
||||
|
||||
As mentioned above, these standard formats may be passed to any function
|
||||
@@ -622,6 +623,42 @@ public:
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxImageDataObject
|
||||
|
||||
wxImageDataObject is a specialization of wxDataObject for image data.
|
||||
It can be used e.g. when you need to put on and retrieve from the clipboard
|
||||
a wxImage with its metadata (like image resolution).
|
||||
|
||||
@since 3.1.5
|
||||
|
||||
@library{wxcore}
|
||||
@category{dnd}
|
||||
|
||||
@see @ref overview_dnd, wxDataObject, wxCustomDataObject, wxBitmapDataObject
|
||||
*/
|
||||
class wxImageDataObject : public wxCustomDataObject
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Constructor, optionally passing an image (otherwise use SetImage()
|
||||
later).
|
||||
*/
|
||||
explicit wxImageDataObject(const wxImage& image = wxNullImage);
|
||||
|
||||
/**
|
||||
Returns the image associated with the data object.
|
||||
*/
|
||||
wxImage GetImage() const;
|
||||
|
||||
/**
|
||||
Sets the image stored by the data object.
|
||||
*/
|
||||
void SetImage(const wxImage& image);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxURLDataObject
|
||||
|
||||
|
Reference in New Issue
Block a user