This class stores information about an image, in binary in-memory form.
Constructor. |
|
Clears the block. |
|
Copy from block. |
|
Makes the image block. |
|
Returns the raw data. |
|
Returns the data size in bytes. |
|
Gets the extension for the block’s type. |
|
Returns the image type. |
|
Initialises the block. |
|
Returns |
|
Load the original image into a memory block. |
|
Uses a wx.Image for efficiency, but can’t set quality (only relevant for |
|
Implementation. |
|
Reads the data in hex from a stream. |
|
Sets the data size. |
|
Sets the image type. |
|
Writes the block to a file. |
|
Writes a memory block to stream. |
|
Writes the data in hex to a stream. |
See |
|
See |
|
See |
Possible constructors:
RichTextImageBlock() -> None
RichTextImageBlock(block : RichTextImageBlock) -> None
This class stores information about an image, in binary in-memory form.
__init__ (self)
Constructor.
None
__init__ (self, block : RichTextImageBlock)
Copy constructor.
block (wx.richtext.RichTextImageBlock)
None
Clears the block.
None
Copy from block.
block (wx.richtext.RichTextImageBlock)
None
Makes the image block.
image (wx.Image)
imageType (BitmapType)
bool
Returns the raw data.
int
Returns the data size in bytes.
int
Gets the extension for the block’s type.
str
Returns the image type.
BitmapType
Initialises the block.
None
Returns True
if the data is not None
.
bool
MakeImageBlock (self, filename : str, imageType : BitmapType, image : Image, convertToJPEG: bool=True)
Load the original image into a memory block.
If the image is not a JPEG
, we must convert it into a JPEG
to conserve space. If it’s not a JPEG
we can make use of image, already scaled, so we don’t have to load the image a second time.
filename (string)
imageType (BitmapType)
image (wx.Image)
convertToJPEG (bool)
bool
MakeImageBlock (self, image : Image, imageType : BitmapType, quality: int=80)
Make an image block from the wx.Image in the given format.
image (wx.Image)
imageType (BitmapType)
quality (int)
bool
Uses a wx.Image for efficiency, but can’t set quality (only relevant for JPEG
)
image (wx.Image)
imageType (BitmapType)
bool
bool
ReadBlock (stream : InputStream, size : int)
Implementation.
Allocates and reads from a stream as a block of memory.
stream (wx.InputStream)
size (int)
int
ReadBlock (filename : str, size : int)
Allocates and reads from a file as a block of memory.
filename (string)
size (int)
int
Reads the data in hex from a stream.
stream (wx.InputStream)
length (int)
imageType (BitmapType)
bool
image (int)
None
Sets the data size.
size (int)
None
Sets the image type.
imageType (BitmapType)
None
Writes the block to a file.
filename (string)
bool
WriteBlock (stream : OutputStream, block : int, size : int)
Writes a memory block to stream.
stream (wx.OutputStream)
block (int)
size (int)
bool
WriteBlock (filename : str, block : int, size : int)
Writes a memory block to a file.
filename (string)
block (int)
size (int)
bool
Writes the data in hex to a stream.
stream (wx.OutputStream)
bool
See GetDataSize
and SetDataSize
See GetExtension
See GetImageType
and SetImageType