hi
what is the code to :
change the screen mode (to 800*600 ).
and change the color depth (to 16 bit) ,.
thanks for help ..
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 .
this is taken directly from my game so im not sure if its any use for you.
to change the screen res....
and to set it back...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;
Code:if Fullscreen then begin ChangeDisplaySettings(devmode(nil^), 0); ShowCursor(True); end;
hope it helps
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