mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
This simple workaround fixes that the animations are not at the right speed (it's a workaround as it would be much nicer if the number of frames is correctly calculated.)
This commit is contained in:
parent
f084d0e95e
commit
95c4ea5cbe
1 changed files with 1 additions and 22 deletions
|
@ -34,7 +34,6 @@ namespace Greenshot.Base.Controls
|
||||||
{
|
{
|
||||||
private static readonly ILog Log = LogManager.GetLogger(typeof(AnimatingForm));
|
private static readonly ILog Log = LogManager.GetLogger(typeof(AnimatingForm));
|
||||||
private const int DEFAULT_VREFRESH = 60;
|
private const int DEFAULT_VREFRESH = 60;
|
||||||
private int _vRefresh;
|
|
||||||
private Timer _timer;
|
private Timer _timer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -45,27 +44,7 @@ namespace Greenshot.Base.Controls
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vertical Refresh Rate
|
/// Vertical Refresh Rate
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected int VRefresh
|
protected int VRefresh => DEFAULT_VREFRESH;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_vRefresh == 0)
|
|
||||||
{
|
|
||||||
// get te hDC of the desktop to get the V-REFRESH
|
|
||||||
using var desktopHandle = SafeWindowDcHandle.FromDesktop();
|
|
||||||
_vRefresh = GDI32.GetDeviceCaps(desktopHandle, DeviceCaps.VREFRESH);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if we are in a Terminal Server session OR need to optimize for RDP / remote desktop connections
|
/// Check if we are in a Terminal Server session OR need to optimize for RDP / remote desktop connections
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue