[fpc-pascal] PTCGraph resolution detection
James Richters
james.richters at productionautomation.net
Fri Mar 22 08:56:33 CET 2024
I found another way to get the screen resolution in Windows that is
consistent between 32bit and 64bit programs using GetSystemMetrics.
uses
Windows;
var
ScreenWidth, ScreenHeight: Integer;
begin
ScreenWidth := GetSystemMetrics(SM_CXSCREEN);
ScreenHeight := GetSystemMetrics(SM_CYSCREEN);
WriteLn('Screen Width: ', ScreenWidth, ' pixels');
WriteLn('Screen Height: ', ScreenHeight, ' pixels');
end.
This works well, and with PTCGraph, there is really no need to bother
figuring out what video modes are available anyway, especially now that we
can have custom resolutions for the PTCGraph window, I just need to make
sure it fits on the screen so it really doesn't matter how I get the screen
resolution.
James
More information about the fpc-pascal
mailing list