diff --git a/GreenshotPlugin/Controls/AnimatingForm.cs b/GreenshotPlugin/Controls/AnimatingForm.cs index 77c2acfc8..3d5324bd3 100644 --- a/GreenshotPlugin/Controls/AnimatingForm.cs +++ b/GreenshotPlugin/Controls/AnimatingForm.cs @@ -29,6 +29,7 @@ namespace GreenshotPlugin.Controls { /// Extend this Form to have the possibility for animations on your form /// public class AnimatingForm : GreenshotForm { + private const int DEFAULT_VREFRESH = 60; private int vRefresh = 0; private Timer timer = null; @@ -51,6 +52,11 @@ namespace GreenshotPlugin.Controls { vRefresh = GDI32.GetDeviceCaps(hDCDesktop, DeviceCaps.VREFRESH); User32.ReleaseDC(hDCDesktop); } + // A vertical refresh rate value of 0 or 1 represents the display hardware's default refresh rate. + // As there is currently no know way to get the default, we guess it. + if (vRefresh <= 1) { + vRefresh = DEFAULT_VREFRESH; + } return vRefresh; } }