***************** wx.PyImageHandler ***************** Inheritance diagram for `wx.PyImageHandler`: | .. inheritance-diagram:: wx.PyImageHandler | Description =========== This is the base class for implementing image file loading/saving, and image creation from data, all written in Python. To create a custom image handler derive a new class from `wx.PyImageHandler` and provide the following methods:: def DoCanRead(self, stream): ''' Check if this handler can read the image on the stream. ''' return a_BOOL_value def LoadFile(self, image, stream, verbose, index): ''' Load image data from the stream and load it into image. ''' return a_BOOL_value def SaveFile(self, image, stream, verbose): ''' Save the image data in image to the stream using this handler's image file format. ''' return a_BOOL_value def GetImageCount(self, stream): ''' If this image format can hold more than one image, how many does the image on the stream have? ''' return a_INT_value To activate your handler create an instance of it and pass it to `wx.Image_AddHandler <../wxFunctions.html#Image_AddHandler>`_. Be sure to call `SetName `_, `SetType `_, and `SetExtension `_ from your constructor. Derived From ^^^^^^^^^^^^^ * `wx.ImageHandler `_ * `wx.Object `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() This is the base class for implementing image file loading/saving, and image creation from data, all written in Python. To create a custom image handler derive a new class from `wx.PyImageHandler` and provide the following methods:: def DoCanRead(self, stream): ''' Check if this handler can read the image on the stream. ''' return a_BOOL_value def LoadFile(self, image, stream, verbose, index): ''' Load image data from the stream and load it into image. ''' return a_BOOL_value def SaveFile(self, image, stream, verbose): ''' Save the image data in image to the stream using this handler's image file format. ''' return a_BOOL_value def GetImageCount(self, stream): ''' If this image format can hold more than one image, how many does the image on the stream have? ''' return a_INT_value To activate your handler create an instance of it and pass it to `wx.Image_AddHandler <../wxFunctions.html#Image_AddHandler>`_. Be sure to call `SetName `_, `SetType `_, and `SetExtension `_ from your constructor. | **Returns:** `wx.PyImageHandler `_