Page 1 of 1

Get Clipboard Image Depth

Posted: Fri Jan 08, 2021 5:59 pm
by IdeasVacuum
The GetClipBoardImage() function offers a choice of colour depth, 24 or 32-bit. Is there a way to verify the colour depth of the image in the Clipboard first?

Re: Get Clipboard Image Depth

Posted: Fri Feb 12, 2021 2:39 pm
by Lunasole
I'm not sure and didn't used it, but maybe it is possible using WinAPI.
Like this example, it returns bitmap headers from clipboard.

Code: Select all

If OpenClipboard_(0)
    Debug GetClipboardData_(#CF_DIB) ; returns pointer to A memory object containing a BITMAPINFO structure followed by the bitmap bits.
    Debug GetClipboardData_(#CF_DIBV5) ; A memory object containing a BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits.

; other flags of GetClipboardData
; https://docs.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats
	CloseClipboard_();
EndIf
So if possible should be somewhere here.

Re: Get Clipboard Image Depth

Posted: Sat Feb 13, 2021 1:20 am
by IdeasVacuum
...That's most interesting Lunasole, I will have a dig at it, thanks.