Skip to content

Latest commit

 

History

History
214 lines (104 loc) · 3.79 KB

PyCBitmap.md

File metadata and controls

214 lines (104 loc) · 3.79 KB

PyCBitmap

PyCBitmap Object

A bitmap class, derived from a PyCGdiObject.

Methods

sentinel 

PyCBitmap.CreateCompatibleBitmap

CreateCompatibleBitmap(dc, width, height) Creates a bitmap compatible with the specified device context.

Parameters

  • 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.

Parameters

  • 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

Return Value

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.

Parameters

  • 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.

Parameters

  • 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.

Parameters

  • 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.

Parameters

  • 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.

Parameters

  • dcObject : PyCDC

    The DC object that has rendered the bitmap.

  • Filename : string

    The file to save the bitmap to