SIMPOL Documentation

wxbitmap

Description

A wxbitmap object represents a bitmap resource that can be provided to any of the wx-based controls that allow a bitmap such as an icon. A separate type may be provided as an image control.

Type Tags

None

Object Value

wxbitmap.new()

Description

Creates a new wxbitmap object either by loading a bitmap from the supplied file name or by loading the bitmap from the blob supplied. If a filename parameter and format are provided then the blob, width and height should not be provided. The reverse is also true.

Prototype

wxbitmap.new ( string filename, string format, blob rgb, integer width, integer height, integer transparencyrgb, integer error )

Parameters

ParameterDefault valueType nameDescription
filenameNonestring The name of the file conatining the bitmap to be loaded.
format"xpm"string The format of the image to be loaded. The supported formats are: "bmp", "png", "jpg", "gif", "pcx", "pnm", "tif", "tga", "iff", "xpm", "ico", "cur", and "ani". Not all image formats may be available on all platforms.
rgbNoneblob A blob containing an image in rgb format (three bytes per pixel). This allows the creation of the image by the program, or the storage of the image in a database field, for example.
widthrgb.size / heightinteger The width of the image contained in rgb. Either the height or the width must be provided when using the rgb argument.
heightrgb.size / widthinteger The height of the image contained in rgb. Either the height or the width must be provided when using the rgb argument.
transparencyrgbNoneinteger When creating an image from a blob, an RGB value can be provided to define the transparency mask of the image. If it is not provided, then the image will not use transparency.
error.nulinteger Specifies an object which is used to output any error code generated during creation of the wxbitmap object. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object and the new() method returns .nul.

Properties

PropertyTypeDescription
_type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided.
__type(*) This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property.
heightinteger Gives the height of the bitmap in pixels.
typetype Specifies the wxbitmap type object.
widthinteger Gives the width of the bitmap in pixels.

Methods

getblob()

Description

Retrieves a blob object that represents the image that is stored in the bitmap object. The correct interpretation of the blob requires the values of the width and height properties of the bitmap object.

Prototype

wxbitmapvar.getblob ()

Parameters

None