Pixelformat(color depth) of desktop

Pixelformat(color depth) of desktop

Post by Walter Laa » Sun, 16 Jan 2000 04:00:00



[Delphi 2] I want to know the pixelformat of the desktop (color depth
8/16/24-bit) in order to load gfx with optimized palettes or gfx
dithered to the standard palette. Sort of TScreen.PixelFormat but that
doesn't exist. I found in Win32 API the function
int GetPixelFormat(HDC hdc);
but then I need to know the (i think device context/gfx handle) of the
desktop
Or maybe in the refistry/other function?
Please help...
 
 
 

Pixelformat(color depth) of desktop

Post by Walter Laa » Sun, 16 Jan 2000 04:00:00


I found out already thanks to Paul Harding!
This is it:

function GetColorDepth: Integer;
var
  DC: HDC;
  Index: Integer;
begin
  Index := BITSPIXEL; // See Win32.hlp GetDeviceCaps
  DC := GetDC(0); {0 = screen}
  Result := GetDeviceCaps(DC, Index);
  ReleaseDC(0, DC);
end;

 
 
 

Pixelformat(color depth) of desktop

Post by Stefan Cruysbergh » Tue, 18 Jan 2000 04:00:00


Hello

The API function GetDesktopWindow gets the handle of the desktop.

Greetings

Stefan Cruysberghs

http://www.bewoner.dma.be/stefancr



Quote:> [Delphi 2] I want to know the pixelformat of the desktop (color depth
> 8/16/24-bit) in order to load gfx with optimized palettes or gfx
> dithered to the standard palette. Sort of TScreen.PixelFormat but that
> doesn't exist. I found in Win32 API the function
> int GetPixelFormat(HDC hdc);
> but then I need to know the (i think device context/gfx handle) of the
> desktop
> Or maybe in the refistry/other function?
> Please help...

 
 
 

1. Filling Desktop (preferably with default desktop image or color)

I am making a login program with an option to clear the station's desktop to
make the interface cleaner for machines that only use my application.  I'd
like to clear the desktop to the options set for the station such as
background image and color.

I would assume, since Windows already does it, that there is a simple
function that will do this before the desktop icons and start menu bar are
displayed.

Any help would be appreciated!  Thanks.

2. Problems with the camera in Maya 2.5/2.5.1

3. Tbitmap pixelformat, color component order constant ?

4. Help with PS to PICT retaining resolution!

5. Wrong colors after changing bitmap pixelformat

6. Graphics character fonts wanted

7. Please Help (desktop colour depth)

8. basic help

9. Bmp Color Depth Convert(1bit to 8bit): 8bitgray vs 8bit Color

10. Need Help - Decrease BMP color depth to 256 color

11. PROBLEM: Colors change at different color depths

12. desktop color distortion under IRIX 6.2

13. Color desktop scanners (a technical discussion begins)