Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows Colours

Posted on 2000-05-11
5
Medium Priority
?
223 Views
Last Modified: 2010-04-04
Hi guys

How do you force Windows to display 16Bit or True Colour, and then also to change it back.
(Got code to change the Resolution but need code for changing the colour too).

Thankx
0
Comment
Question by:PieterJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:edey
ID: 2803249
from win32.hlp:

The ChangeDisplaySettings function changes the display settings to the specified graphics mode.

LONG ChangeDisplaySettings(

    LPDEVMODE  lpDevMode,      
    DWORD  dwflags      
   );


GL
Mike
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2803308
before ChangeDisplaySettings , your maybe do this:

BOOL EnumDisplaySettings(

    LPCTSTR lpszDeviceName,      // specifies the display device
    DWORD iModeNum,      // specifies the graphics mode
    LPDEVMODE lpDevMode      // points to structure to receive settings
   );      
 

Good Luck!

shenqw
0
 

Author Comment

by:PieterJ
ID: 2803314
Thanks Mike and Shenqw,
have you guys got an example eg. changing colours from 16Bit to 256 Colours or whatever?
Thankx again !
0
 
LVL 3

Accepted Solution

by:
shenqw earned 200 total points
ID: 2803392
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
  procedure NewScreenSize(W,H: Integer);
  var
    DevMode: TDevMode;
  begin
    if EnumDisplaySettings(nil,0,DevMode) then
    begin
      with DevMode do begin
        dmPelsWidth := W;
        dmPelsHeight := H;
        dmBitsPerPel:=16;  
        dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL;
      end;
      ChangeDisplaySettings(DevMode, 0);
    end;
  end;

begin
  NewScreenSize(800,600);
end;

end.



dmBitsPerPel

Specifies the color resolution, in bits per pixel, of the display device (for example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for 65536 colors). Display drivers use this member, for example, in the ChangeDisplaySettings function. Printer drivers do not use this member.
0
 

Author Comment

by:PieterJ
ID: 2803407
Thanx a lot !!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question