Get Clipboard Image Depth

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Get Clipboard Image Depth

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Get Clipboard Image Depth

Post 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.
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Get Clipboard Image Depth

Post by IdeasVacuum »

...That's most interesting Lunasole, I will have a dig at it, thanks.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply