R.Wieser
2021-02-03 07:27:46 UTC
I've been trying to use CreateDIBSection to create a 2bpp bitmap, which
fails (4bpp works). While looking thru the docs.microsoft.com webpage
regarding the function in search of /why/ it fails I stumbled over the
following :
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createdibsection
- - - - - - - - - - - - - - - - - - - -
If the function fails, the return value is NULL, and *ppvBits is NULL.
This function can return the following value.
Return code Description
ERROR_INVALID_PARAMETER One or more of the input parameters is invalid.
- - - - - - - - - - - - - - - - - - - -
And yes, that is as close together as I've posted it.
So, an error exits is indicated by a NULL *AND* a (possible) 0x57 value ?
That doesn't make any sense ...
And no, CreateDIBSection doesn't set the 'GetLastError' value (just tested
it). :-)
So, two questions:
1) How can I check /what/ went wrong ?
2) Does CreateDIBSection accept a 2 bits per color (CGA) setting ?
Regards,
Rudy Wieser
fails (4bpp works). While looking thru the docs.microsoft.com webpage
regarding the function in search of /why/ it fails I stumbled over the
following :
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createdibsection
- - - - - - - - - - - - - - - - - - - -
If the function fails, the return value is NULL, and *ppvBits is NULL.
This function can return the following value.
Return code Description
ERROR_INVALID_PARAMETER One or more of the input parameters is invalid.
- - - - - - - - - - - - - - - - - - - -
And yes, that is as close together as I've posted it.
So, an error exits is indicated by a NULL *AND* a (possible) 0x57 value ?
That doesn't make any sense ...
And no, CreateDIBSection doesn't set the 'GetLastError' value (just tested
it). :-)
So, two questions:
1) How can I check /what/ went wrong ?
2) Does CreateDIBSection accept a 2 bits per color (CGA) setting ?
Regards,
Rudy Wieser