CIJLBitmap v1.22
Welcome to CIJLBitmap, A freeware MFC class based in part on CBitmap and CPalette which provides support for loading Device Independent Bitmaps (DIBS) and jpegs from disk. Support is provided for Loading BMP's from file and resource, loading Jpeg files and saving to BMP's on file.
Features |
Usage |
History |
API Reference |
Planned Enhancements |
Contacting the Author |
V1.0 (3 April 2000)
V1.1 (10 April 2000)
V1.2 (30 July 2000)
V1.21 (31 July 2000)
V1.22 (1 August 2001)
The API consists of the following class members
CIJLBitmap::Load
CIJLBitmap::LoadBmp
CIJLBitmap::Rect
CIJLBitmap::Size
CIJLBitmap::Draw
CIJLBitmap::DeleteObject
CIJLBitmap::Palette
CIJLBitmap::Save
BOOL Load(LPCTSTR lpszPathName);
Return Value
TRUE if the file was loaded successfully otherwise FALSE.
Parameters
lpszPathName The name of the image file to load.
Remarks
Loads an image from disk. The type supported are DIB (*.bmp, *.DIB), Jpeg (*.jpg, *.jpeg).
BOOL LoadBmp(HINSTANCE hInst,
LPCTSTR lpResourceName);
BOOL LoadBmp(HINSTANCE hInst,
UNINT uID);
Return Value
TRUE if the bitmap file was loaded successfully otherwise FALSE.
Parameters
hInst The instance handle to load from
uID The resource ID of the resource to load.
lpResourceName The resource ID of the resource to load.
Remarks
This function loads a DIB from a resource.
CRect Rect();
CSize Size()
Remarks
These methods are simple accessors for the size of the bitmap expressed as a CRect or a CSize.
BOOL Draw(CDC* pDC, DWORD dwRop = SRCCOPY, BOOL bBackground = FALSE, const CRect* rcDst = NULL, const CRect* rcSrc = NULL, CPalette* pPal = NULL);
Return Value
TRUE if the bitmap was successfully drawn otherwise FALSE.
Parameters
pDC The device context where the bitmap is to be drawn to.
dwRop The Raster operation code to use when drawing the bitmap.
bBackground TRUE if the palette should be realized in the background otherwise FALSE if normal realization.
rcDst The destination rectangle of the bitmap. Leave NULL if you want the bitmap to be drawn 100% sized at offset point 0,0.
rcSrc The source rectangle of the bitmap. Leave NULL if you want all the bitmap drawn.
pPal The palette to use when drawing the bitmap. Leave NULL if you want the palette associated with the bitmap to be used
Remarks
This function draws the bitmap to a device context.
BOOL DeleteObject();
Return Value
Nonzero if the object was successfully deleted; otherwise 0.
Remarks
Deletes any associated resources which the bitmap has. Internally all that is done is that the IPicture interface is released.
CPalette& Palette();
Remarks
This method provides access to the palette associated with this DIB. This is sometimes required externally if you need to implement palette handling code in your classes.
BOOL Save(LPCTSTR lpszPathName);
Return Value
TRUE if the file was successfully saved otherwise FALSE.
Parameters
lpszPathName The name of the image file to save as.
Remarks
Saves an image to disk. The type written will always be a DIB i.e. *.bmp or *.DIB.
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
1 August 2001