怎样自动获取电脑所能支持的分辨率、刷新率、色彩度等参数???(100分)

  • 主题发起人 主题发起人 lihuihj
  • 开始时间 开始时间
L

lihuihj

Unregistered / Unconfirmed
GUEST, unregistred user!
[:(][:(]怎样自动获取电脑所能支持的分辨率、刷新率、色彩度等参数???
 
procedure GetVideoModes(ModeList: TStringList);

var
i, j: integer;
MoreModes,
AddMode: boolean;
dm: TDeviceMode;
Mode: string;
begin
ModeList.Clear;
MoreModes := True;
Mode := ';
i := 0;
while MoreModes do
begin
MoreModes := EnumDisplaySettings(nil, i, dm);
Mode := IntToStr(dm.dmBitsPerPel) + ' Bits Per Pixel ' +
IntToStr(dm.dmPelsWidth) + ' x ' +
IntToStr(dm.dmPelsHeight);
AddMode := True;
{ Check to make sure this mode is not already in the list. }
for j := 0 to ModeList.Count-1 do
if Mode = ModeList[j] then
AddMode := False;
if AddMode then
ModeList.Add(Mode);
Inc(i);
end;
end;
 
var
x:longint;
a:string;
begin
x := GetSystemMetrics(SM_CXSCREEN);
Str(x,a);
Label1.Caption := '显示器水平分辨率' + a;
x := GetSystemMetrics(SM_CYSCREEN);
Str(x,a);
Label2.Caption := '显示器垂直分辨率' + a;
end;
 
严重同意tseug的方法
 
多人接受答案了。
 
后退
顶部