From 97a853d45026d5063f6d658f9d8f392f9add0798 Mon Sep 17 00:00:00 2001 From: RKrom Date: Thu, 10 Jan 2013 07:25:44 +0000 Subject: [PATCH] Fix for bug #3600171, using a default VRefresh if the returned value is 0 or 1. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2422 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- GreenshotPlugin/Controls/AnimatingForm.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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; } }