wxRuby Documentation Home

Wx::ImageHandler

This is the base class for implementing image file loading/saving, and image creation from data.
It is used within Image and is not normally seen by the application.

If you wish to extend the capabilities of Image, derive a class from ImageHandler
and add the handler using Image#add_handler in your
application initialisation.

Note (Legal Issue)

This software is based in part on the work of the Independent JPEG Group.

(Applies when Widgets is linked with JPEG support. JPEGHandler uses libjpeg
created by IJG.)

Derived from

Object

See also

Image,
InitAllImageHandlers

Methods

ImageHandler.new

destructor()

Destroys the ImageHandler object.

ImageHandler#get_name

String get_name()

Gets the name of this handler.

ImageHandler#get_extension

String get_extension()

Gets the file extension associated with this handler.

ImageHandler#get_image_count

Integer get_image_count(%(arg-type)InputStream% stream)

If the image file contains more than one image and the image handler is capable
of retrieving these individually, this function will return the number of
available images.

Return value

Number of available images. For most image handlers, this is 1 (exceptions
are TIFF and ICO formats).

ImageHandler#get_type

Integer get_type()

Gets the image type associated with this handler.

ImageHandler#get_mime_type

String get_mime_type()

Gets the MIME type associated with this handler.

ImageHandler#load_file

Boolean load_file(%(arg-type)Image% image, InputStream stream, Boolean verbose=true, Integer index=0)

Loads a 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

Return value

true if the operation succeeded, false otherwise.

See also

Image#load_file,
Image#save_file,
ImageHandler#save_file

ImageHandler#save_file

Boolean save_file(%(arg-type)Image% image, OutputStream stream)

Saves a image in the output stream.

Parameters

Return value

true if the operation succeeded, false otherwise.

See also

Image#load_file,
Image#save_file,
ImageHandler#load_file

ImageHandler#set_name

set_name(%(arg-type)String% name)

Sets the handler name.

Parameters

ImageHandler#set_extension

set_extension(%(arg-type)String% extension)

Sets the handler extension.

Parameters

ImageHandler#set_mime_type

set_mime_type(%(arg-type)String% mimetype)

Sets the handler MIME type.

Parameters

ImageHandler#set_type

set_type(%(arg-type)Integer% type)

Sets the handler type.

Parameters

[This page automatically generated from the Textile source at 2023-06-03 08:07:28 +0000]