Mega Code Archive

 
Categories / Delphi / Graphic
 

Get color depth (bits)

Title: Get color depth (bits) Use GetDeviceCaps function with BITSPIXEL parameter. This function returns number of adjacent color bits for each pixel. procedure TForm1.Button1Click(Sender: TObject); var TempDC: HDC; i: Integer; begin TempDC:=GetDC(GetDesktopWindow); i:=GetDeviceCaps(TempDC, BITSPIXEL); Label1.Caption:='Color schema '+IntToStr(i)+' bits'; end;