Re: Simple bitmap program
Reading bitmap files requires a bit more parsing of header information. See MSDN for more information.
Re: Simple bitmap program
You have to create a dibsection from your bitmap; then you can access the bits directly, as in the following example:
HBITMAP hBitmap = (HBITMAP) ::LoadImage(NULL, "myBitmap.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);
if (hBitmap)
{
BITMAP bm;
::GetObject(hBitmap, sizeof(BITMAP), &bm);
if (bm.bmBits)
{
// access the bitmap bits here,
// be sure to check the format first
}
}
Please check the following links, as they can be of interest:
http://libcaca.zoy.org (this seems to be temporarily down)
http://aa-project.sourceforge.net/gallery