A bitmap class, derived from a PyCGdiObject.
-
Creates a bitmap compatible with the specified device context.
-
Gets the size of the bitmap object, in pixels.
-
Returns the HBITMAP for a bitmap.
-
Loads a bitmap from a DLL object.
-
Loads a bitmap from a file object.
-
Loads a bitmap from a file object containing a PPM format bitmap.
-
Paints a bitmap to a windows DC.
-
Returns the BITMAP structure info.
-
Returns the bitmap bits.
-
Saves a bitmap to a file.
sentinel
PyCBitmap.CreateCompatibleBitmap
CreateCompatibleBitmap(dc, width, height) Creates a bitmap compatible with the specified device context.
-
dc : PyCDC
Specifies the device context.
-
width : int
The width (in bits) of the bitmap
-
height : int
The height (in bits) of the bitmap.
PyCBitmap.GetBitmapBits
tuple/string = GetBitmapBits(asString) Returns the bitmap bits.
-
asString=0 : int
If False, the result is a tuple of
integers, if True, the result is a Python string
PyCBitmap.GetHandle
int = GetHandle() Returns the HBITMAP for a bitmap object
PyCBitmap.GetInfo
dict = GetInfo() Returns the BITMAP structure info
A dictionary of integers, keyed by the following strings:
bmType
bmWidth
bmHeight
bmWidthBytes
bmPlanes
bmBitsPixel
PyCBitmap.GetSize
(cx,cy) = GetSize() Returns the size of the bitmap object.
PyCBitmap.LoadBitmap
LoadBitmap(idRes, obDLL) Loads a bitmap from a DLL object.
-
idRes : int
The resource ID of the bitmap
-
obDLL=None : PyDLL
The DLL object to load from.
PyCBitmap.LoadBitmapFile
LoadBitmapFile(fileObject) Loads a bitmap (.BMP) format
from a file object.
-
fileObject : file[.read]
The file object to load the .BMP format file from.
PyCBitmap.LoadPPMFile
LoadPPMFile(fileObject, cols, rows) Loads a bitmap in Portable Pix Map (PPM) format
from a file object.
-
fileObject : file[.read]
The file object to load the PPM format file from.
-
cols : int
The number of columns in the bitmap.
-
rows : int
The number of rows in the bitmap.
PyCBitmap.Paint
Paint(dcObject, rectDest, rectSrc) Paint a bitmap.
-
dcObject : PyCDC
The DC object to paint the bitmap to.
-
rectDest=(0,0,0,0) : (left,top,right,bottom)
The destination rectangle to paint to.
-
rectSrc=(0,0,0,0) : (left,top,right,bottom)
The source rectangle to paint from.
PyCBitmap.SaveBitmapFile
None = SaveBitmapFile(dcObject, Filename
) Saves a bitmap to a file.
-
dcObject : PyCDC
The DC object that has rendered the bitmap.
-
Filename : string
The file to save the bitmap to