phoenix_title wx.GIFHandler

This is the image handler for the GIF format.

See also

wx.Image, wx.ImageHandler, wx.InitAllImageHandlers


class_hierarchy Class Hierarchy

Inheritance diagram for class GIFHandler:

method_summary Methods Summary

__init__

Default constructor for wx.GIFHandler.

DoCanRead

Called to test if this handler can read an image from the given stream.

LoadFile

Loads an image from a stream, putting the resulting data into image.

SaveAnimation

Save the animated gif.

SaveFile

Saves an image in the output stream.


api Class API

class wx.GIFHandler(ImageHandler)

Possible constructors:

GIFHandler()

This is the image handler for the GIF format.


Methods

__init__(self)

Default constructor for wx.GIFHandler.



DoCanRead(self, stream)

Called to test if this handler can read an image from the given stream.

NOTE: this function is allowed to change the current stream position since CallDoCanRead() will take care of restoring it later

Parameters:

stream (wx.InputStream) –

Return type:

bool



LoadFile(self, image, stream, verbose=True, index=-1)

Loads an image from a stream, putting the resulting data into image.

If the image file contains more than one image and the image handler is capable of retrieving these individually, index indicates which image to read from the stream.

Parameters:
  • image (wx.Image) – The image object which is to be affected by this operation.

  • stream (wx.InputStream) – Opened input stream for reading image data.

  • verbose (bool) – If set to True, errors reported by the image handler will produce LogMessages.

  • index (int) – The index of the image in the file (starting from zero).

Return type:

bool

Returns:

True if the operation succeeded, False otherwise.



SaveAnimation(self, images, stream, verbose=True, delayMilliSecs=1000)

Save the animated gif.

Parameters:
  • images (ImageArray) – The image array object which is to be affected by this operation.

  • stream (wx.OutputStream) – Opened output stream for writing the data.

  • verbose (bool) – If set to True, errors reported by the image handler will produce LogMessages

  • delayMilliSecs (int) – How long, in milliseconds, to wait between each frame.

Return type:

bool

Returns:

True if the operation succeeded, False otherwise.



SaveFile(self, image, stream, verbose=True)

Saves an image in the output stream.

Parameters:
  • image (wx.Image) – The image object which is to be affected by this operation.

  • stream (wx.OutputStream) – Opened output stream for writing the data.

  • verbose (bool) – If set to True, errors reported by the image handler will produce LogMessages.

Return type:

bool

Returns:

True if the operation succeeded, False otherwise.