如何取得電腦所有支援的螢幕解析度與顏色數? |
|
領航天使
站長 發表:12216 回覆:4186 積分:4084 註冊:2001-07-25 發送簡訊給我 |
// 如何取得電腦所有支援的螢幕解析度與顏色數?
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure GetVideoModes(ModeList: TStrings); 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; procedure TForm1.Button1Click(Sender: TObject); begin GetVideoModes(memo1.lines); end; end.~~~Delphi K.Top討論區站長~~~
------
~~~Delphi K.Top討論區站長~~~ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |