mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
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
This commit is contained in:
parent
a12b7e3a38
commit
97a853d450
1 changed files with 6 additions and 0 deletions
|
@ -29,6 +29,7 @@ namespace GreenshotPlugin.Controls {
|
||||||
/// Extend this Form to have the possibility for animations on your form
|
/// Extend this Form to have the possibility for animations on your form
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AnimatingForm : GreenshotForm {
|
public class AnimatingForm : GreenshotForm {
|
||||||
|
private const int DEFAULT_VREFRESH = 60;
|
||||||
private int vRefresh = 0;
|
private int vRefresh = 0;
|
||||||
private Timer timer = null;
|
private Timer timer = null;
|
||||||
|
|
||||||
|
@ -51,6 +52,11 @@ namespace GreenshotPlugin.Controls {
|
||||||
vRefresh = GDI32.GetDeviceCaps(hDCDesktop, DeviceCaps.VREFRESH);
|
vRefresh = GDI32.GetDeviceCaps(hDCDesktop, DeviceCaps.VREFRESH);
|
||||||
User32.ReleaseDC(hDCDesktop);
|
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;
|
return vRefresh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue