Toon posts:

[Delphi] Hoe kan ik alle refreshrates van een monitor vinden

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik moet een lijstje hebben met alle refreshrates van een monitor.

Waar haal ik die weg?

  • Glimi
  • Registratie: Augustus 2000
  • Niet online

Glimi

Designer Drugs

(overleden)
Heb je Welkom in P&W -> Quickstart (update 2/10/2002) gelezen? We vereisen voor een topic hier iets meer dan een vraag van 2 regels :)

We willen ook weten wat jij geprobeerd hebt, wat wel lukte en wat niet ed. :) Dit doen we niet om je te pesten maar omdat we inzet van jouw kant willen zien (we zijn immers geen helpdesk) maar ook zodat jij geen tips krijgt over dingen die je al geprobeerd hebt :)

Zou je dus je post willen aanvullen met de gevraagde info?

[ Voor 7% gewijzigd door Glimi op 06-03-2003 14:56 ]


  • .oisyn
  • Registratie: September 2000
  • Laatst online: 22-08 13:19

.oisyn

Moderator Devschuur®

Demotivational Speaker

Hoe kan ik alle refreshrates van een monitor vinden
staat in de handleiding van je monitor

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


Verwijderd

Gewoon standaard Win32A API werk :)
DEVMODE struct zal wel wonderen doen :)

dmDisplayFrequency -> refresh rate in hertz

[ Voor 65% gewijzigd door Verwijderd op 06-03-2003 15:51 ]


Verwijderd

Topicstarter
Nou, ik heb google helemaal dood gelezen ongeveer, maar kon dus echt niks vinden.

Tevens in de help van delphi en de win32 users reference gezocht, vond ie ook absoluut niks.

Excuus voor de botte vraagstelling ;)

Verwijderd

Topicstarter
Tis namelijk de bedoeling dat ik een lijst krijg met alle mogelijke refreshrates, voor stimulus-respons applicaties bij een psychologische afdeling van de rijks universiteit Groningen.

  • .oisyn
  • Registratie: September 2000
  • Laatst online: 22-08 13:19

.oisyn

Moderator Devschuur®

Demotivational Speaker

met GetDisplaySettings () kun je iig de huidige refreshrate opvragen. Een lijst kun je (zonder DirectX) niet echt opvragen, maar je kunt wel modii testen met ChangeDisplaySettings (), en dus zo bepalen welke refreshrates worden ondersteund voor een bepaalde resolutie

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.


Verwijderd

Topicstarter
okee bedankt.

  • Tomatoman
  • Registratie: November 2000
  • Laatst online: 22:26

Tomatoman

Fulltime prutser

Het kan wel degelijk met behulp van EnumDisplaySettings. Uit The Tomes of Delphi 3: Win32 Graphics API van Larry Diehl:
Delphi:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
procedure TForm1.Button1Click(Sender: TObject);
var
  DeviceInfo: TDevMode;         // holds device information
  DeviceCount: Integer;         // tracks the number of display modes
begin
  {initialize the tracking variable}
  DeviceCount := 0;
  {enumerate all display modes for the current display device}
  while EnumDisplaySettings(NIL, DeviceCount, DeviceInfo) do
  begin
    {display the relevent information for the display mode}
    ListBox1.Items.Add('Device '+IntToStr(DeviceCount)+' -');
    ListBox1.Items.Add('Pixels/Inch: '+IntToSTr(DeviceInfo.dmLogPixels));
    ListBox1.Items.Add('Bits/Pixel: '+IntToStr(DeviceInfo.dmBitsPerPel));
    ListBox1.Items.Add('Pixel Width: '+IntToStr(DeviceInfo.dmPelsWidth));
    ListBox1.Items.Add('Pixel Height: '+IntToStr(DeviceInfo.dmPelsHeight));
    {indicate the display mode type}
    case DeviceInfo.dmDisplayFlags of
      DM_GRAYSCALE:  ListBox1.Items.Add('Display Mode: Grayscale');
      DM_INTERLACED: ListBox1.Items.Add('Display Mode: Interlaced');
    end;
    {indicate the refresh rate}
    if (DeviceInfo.dmDisplayFrequency=0)or(DeviceInfo.dmDisplayFrequency=1) then
      ListBox1.Items.Add('Refresh Rate: Hardware Default')
    else
      ListBox1.Items.Add('Refresh Rate: ' +
        IntToStr(DeviceInfo.dmDisplayFrequency)+' hrz');
    {add a blank line and increment the tracking variable}
    ListBox1.Items.Add('');
    Inc(DeviceCount);
  end;
end;

Een goede grap mag vrienden kosten.


Verwijderd

Topicstarter
Bedankt Tomatoman! Hier heb ik echt wat aan..

Je laatste heb ik ook gebruikt. Thanks!
Pagina: 1