wx.PyImageHandler

Inheritance diagram for 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. Be sure to call SetName, SetType, and SetExtension from your constructor.

Methods Summary

Class API

Methods

__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. Be sure to call SetName, SetType, and SetExtension from your constructor.


Returns:

wx.PyImageHandler