.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.ImageDataObject:

==========================================================================================================================================
|phoenix_title|  **wx.ImageDataObject**
==========================================================================================================================================

:ref:`wx.ImageDataObject`  is a specialization of :ref:`wx.DataObject`  for image data.          

It can be used e.g. when you need to put on and retrieve from the clipboard a :ref:`wx.Image`  with its metadata (like image resolution). 





         



.. versionadded:: 4.1/wxWidgets-3.1.5  
    







.. seealso:: :ref:`Drag and Drop Overview <drag and drop overview>`, :ref:`wx.DataObject`, :ref:`wx.CustomDataObject`, :ref:`wx.BitmapDataObject`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>ImageDataObject</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.ImageDataObject_inheritance.png" alt="Inheritance diagram of ImageDataObject" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ImageDataObject.html" title="wx.ImageDataObject" alt="" coords="10,237,169,267"/> <area shape="rect" id="node2" href="wx.CustomDataObject.html" title="wx.CustomDataObject" alt="" coords="5,160,173,189"/> <area shape="rect" id="node3" href="wx.DataObjectSimple.html" title="wx.DataObjectSimple" alt="" coords="8,83,171,112"/> <area shape="rect" id="node4" href="wx.DataObject.html" title="wx.DataObject" alt="" coords="30,5,149,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.ImageDataObject.__init__`                                             Constructor, optionally passing an image (otherwise use :meth:`~ImageDataObject.SetImage`   later).
:meth:`~wx.ImageDataObject.GetAllFormats`                                        Returns a list of wx.DataFormat objects which this data object
:meth:`~wx.ImageDataObject.GetImage`                                             Returns the image associated with the data object.
:meth:`~wx.ImageDataObject.SetData`                                              
:meth:`~wx.ImageDataObject.SetImage`                                             Sets the image stored by the data object.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ImageDataObject.AllFormats`                                           See :meth:`~wx.ImageDataObject.GetAllFormats`
:attr:`~wx.ImageDataObject.Image`                                                See :meth:`~wx.ImageDataObject.GetImage` and :meth:`~wx.ImageDataObject.SetImage`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.ImageDataObject(CustomDataObject)

   **Possible constructors**::

       ImageDataObject(image=NullImage)
       
   
   ImageDataObject is a specialization of DataObject for image data.



   .. method:: __init__(self, image=NullImage)

      Constructor, optionally passing an image (otherwise use :meth:`SetImage`   later).                  


      :param `image`: 
      :type `image`: wx.Image







   .. method:: GetAllFormats(self, dir=DataObject.Get)

                              Returns a list of wx.DataFormat objects which this data object
                              supports transferring in the given direction.  





   .. method:: GetImage(self)

      Returns the image associated with the data object.                  

      :rtype: :ref:`wx.Image`








   .. method:: SetData(self, format, buf)



      :rtype: `bool`








   .. method:: SetImage(self, image)

      Sets the image stored by the data object.                  


      :param `image`: 
      :type `image`: wx.Image







   .. attribute:: AllFormats

      See :meth:`~wx.ImageDataObject.GetAllFormats`


   .. attribute:: Image

      See :meth:`~wx.ImageDataObject.GetImage` and :meth:`~wx.ImageDataObject.SetImage`

