You can list through the default GraphicAdapter property DisplayModeCollection to find a DisplayMode with a maximum width / height / aspect ratio.
Sort of:
GraphicsAdapter defaultAdapter = GraphicsAdapter.DefaultAdapter;
DisplayMode maxMode = defaultAdapter.DisplayModeCollection[0];
foreach (DisplayMode enumeratedDisplay in defaultAdapter.DisplayModeCollection)
{
//Test enumeratedDisplay against maxMode, setting maxMode to enumeratedDisplay if enumeratedDisplay is better
}
Maybe there is a better way, but of course, one way to find the maximum size.
Or you can take the same DisplayModeCollection and fill out a comboBox sort or list, allowing the user to choose for themselves.
My apologies if the above code does not work in this exact form. I canβt check it where I am
source
share