AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Screen Resolution and Tlistbox

Ein Thema von Razor · begonnen am 11. Feb 2009 · letzter Beitrag vom 11. Feb 2009
Antwort Antwort
Razor
(Gast)

n/a Beiträge
 
#1

Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 19:48
I got a problem i can generate supported resolution modes in a ilstbox,right..
Then i got this after calling the enumdisplaysettings.This is in a listbox.

640X480 8 bit
640X480 8 bit
640X480 8 bit
640X480 8 bit
640X480 16 bit
640X480 16 bit
640X480 16 bit
640X480 16 bit

Can i somehow filter(remove) the items that have the same name.Couse i dont need that many items that are the same its confusing!
  Mit Zitat antworten Zitat
Benutzerbild von Bernhard Geyer
Bernhard Geyer

Registriert seit: 13. Aug 2002
17.171 Beiträge
 
Delphi 10.4 Sydney
 
#2

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 19:50
Write the items first in a TStringList with MyStringList.Duplicates := dupIgnore; set and then assign it to the ListBox with MyListBox.Items.Assign(MyStringList);
Windows Vista - Eine neue Erfahrung in Fehlern.
  Mit Zitat antworten Zitat
Benutzerbild von Meflin
Meflin

Registriert seit: 21. Aug 2003
4.856 Beiträge
 
#3

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 19:55
How do you call enumdisplaysettings? It doens't return duplicate entries.
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#4

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 19:56
Delphi-Quellcode:
procedure tform4.res;

var
  i : Integer;
  DevMode : TDeviceMode;
begin
  i:=0;


  while EnumDisplaySettings(nil,i,DevMode) do begin
    with Devmode do
      ListBox1.Items.Add(Format('%dx%d %d Colors',[dmPelsWidth,dmPelsHeight,1 shl dmBitsperPel]));
    Inc(i);
  end;

end;
[edit=mkinzler]Better readable with Delphi-Tags Mfg, mkinzler[/edit]
  Mit Zitat antworten Zitat
Benutzerbild von Meflin
Meflin

Registriert seit: 21. Aug 2003
4.856 Beiträge
 
#5

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 20:00
Hm, so I guess this is due to different refresh rates? Anyway, adding a mode only if it's not already in the list is preferable rather than removing duplicate entries afterwards.

By the way, you can find a complete implementation here (that ignores the duplicates):
http://burks.brighton.ac.uk/burks/la...s/fullscrn.htm
  Mit Zitat antworten Zitat
Razor
(Gast)

n/a Beiträge
 
#6

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 20:01
Crap i always do something wrong...
  Mit Zitat antworten Zitat
Satty67

Registriert seit: 24. Feb 2007
Ort: Baden
1.566 Beiträge
 
Delphi 2007 Professional
 
#7

Re: Screen Resolution and Tlistbox

  Alt 11. Feb 2009, 20:11
Here my way :
Delphi-Quellcode:
var
  i : Integer;
  DevMode : TDeviceMode;
  s : String;
begin
  i:=0;


  while EnumDisplaySettings(nil,i,DevMode) do begin
    with Devmode do
      s := Format('%dx%d %d Colors',[dmPelsWidth,dmPelsHeight,1 shl dmBitsperPel]);
    if ListBox1.Items.IndexOf(s) < 0 then ListBox1.Items.Add(s);

    Inc(i);
  end;

end;
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:26 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz