Sunday, August 7, 2011

Get the Current Screen Resolution

It's about MaxScript. Even busy, time-to-time I help with what I can. Ok, its maybe not so special, but I think will be good to post this tip here anyway.

The question was - How to get the current screen resolution in MaxScript? The available built-in function sysInfo.desktopSize is fine if we use single monitor, but on multiple monitors this function return the full resolution of all monitors. So here is a function for that case:

fn ScreenResolution = (

local scr = (dotNetClass "System.Windows.Forms.Screen").PrimaryScreen.Bounds
[scr.Width, scr.Height]

No comments:

Post a Comment

Thanks for your comment