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
,
string filename
,
blob format
,
integer rgb
,
integer width
,
integer height
,
integer transparencyrgb
)
error
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
filename | None | string | 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. |
rgb | None | blob | 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. |
width | rgb.size / height | integer |
The width of the image contained in rgb . Either the height
or the width must be provided when using the rgb
argument.
|
height | rgb.size / width | integer |
The height of the image contained in rgb . Either the height
or the width must be provided when using the rgb
argument.
|
transparencyrgb | None | integer | 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 | .nul | integer |
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
Property | Type | Description |
---|---|---|
_ | 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. |
height | integer | Gives the height of the bitmap in pixels. |
type | type | Specifies the wxbitmap type object. |
width | integer | 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