Package wx :: Class PyImageHandler
[frames | no frames]

Type PyImageHandler

object --+        
         |        
    Object --+    
             |    
  ImageHandler --+
                 |
                PyImageHandler


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) --> bool
    '''Check if this handler can read the image on the stream'''

def LoadFile(self, image, stream, verbose, index) --> bool
    '''Load image data from the stream and load it into image.'''

def SaveFile(self, image, stream, verbose) --> bool
    '''Save the iamge data in image to the stream using
       this handler's image file format.'''

def GetImageCount(self, stream) --> int
    '''If this image format can hold more than one image,
       how many does the image on the stream have?'''

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.


Method Summary
PyImageHandler __init__(self)
This is the base class for implementing image file loading/saving, and image creation from data, all written in Python.
  __repr__(self)
    Inherited from ImageHandler
bool CanRead(self, name)
String GetExtension(self)
String GetMimeType(self)
String GetName(self)
long GetType(self)
  SetExtension(self, extension)
  SetMimeType(self, mimetype)
  SetName(self, name)
  SetType(self, type)
    Inherited from Object
  Destroy(self)
Deletes the C++ object this Python object is a proxy for.
String GetClassName(self)
Returns the class name of the C++ class using wxRTTI.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Method Details

__init__(self)
(Constructor)

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) --> bool
    '''Check if this handler can read the image on the stream'''

def LoadFile(self, image, stream, verbose, index) --> bool
    '''Load image data from the stream and load it into image.'''

def SaveFile(self, image, stream, verbose) --> bool
    '''Save the iamge data in image to the stream using
       this handler's image file format.'''

def GetImageCount(self, stream) --> int
    '''If this image format can hold more than one image,
       how many does the image on the stream have?'''

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:
PyImageHandler
Overrides:
wx.ImageHandler.__init__

Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:52:36 2007 http://epydoc.sf.net