Results 1 to 3 of 3

Thread: (800*600 and 16 bit) what is the code .

  1. #1

    (800*600 and 16 bit) what is the code .

    hi
    what is the code to :
    change the screen mode (to 800*600 ).
    and change the color depth (to 16 bit) ,.

    thanks for help ..
    Ask them just what they think Delphi can't do, and show them they're wrong! Abo Delphi .

  2. #2

    (800*600 and 16 bit) what is the code .

    this is taken directly from my game so im not sure if its any use for you.


    to change the screen res....

    Code:
    var
      dmScreenSettings : DEVMODE;
    
    ...
    
      if Fullscreen then
      begin
        ZeroMemory(@dmScreenSettings, SizeOf(dmScreenSettings));
        with dmScreenSettings do begin
          dmSize       := SizeOf(dmScreenSettings);
          dmPelsWidth  := Width;
          dmPelsHeight := Height;
          dmBitsPerPel := PixelDepth;
          dmFields     := DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL;
        end;
    
    
        if (ChangeDisplaySettings(dmScreenSettings, CDS_FULLSCREEN) = DISP_CHANGE_FAILED) then
        begin
          MessageBox(0, 'Unable to switch to fullscreen!', 'Error', MB_OK or MB_ICONERROR);
          Fullscreen := False;
        end;
      end;
    and to set it back...

    Code:
      if Fullscreen then
      begin
        ChangeDisplaySettings(devmode(nil^), 0);
        ShowCursor(True);
      end;

    hope it helps

  3. #3

    thanks alot

    thanks alot DumasS , i think it can be usefull .

    and thats another code :

    [pascal]procedure TForm1.setscreen(width,hight,deep:integer);

    Var OldVal: _devicemodeA;
    index:integer;
    Begin
    index:=1;
    While EnumDisplaySettings(nil, i, OldVal) do
    begin

    if OldVal.dmPelsWidth=width then
    if OldVal.dmPelsHeight=hight then
    if OldVal.dmBitsPerPel = deep then begin
    If EnumDisplaySettings(nil, i, OldVal) Then
    ChangeDisplaySettings( OldVal, 0);
    break;
    end;
    I:= I+1;
    end;
    end;[/pascal]
    Ask them just what they think Delphi can't do, and show them they're wrong! Abo Delphi .

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •