-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #3 Added an opportunity to record an image stream to avi file.
- Loading branch information
1 parent
8ac9f30
commit 2c5b3c9
Showing
21 changed files
with
615 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Threading; | ||
using WindowTextExtractor.Native; | ||
|
||
namespace WindowTextExtractor | ||
{ | ||
class AccurateTimer | ||
{ | ||
private int _timerId; | ||
private Action _action; | ||
private Winmm.TimerEventDelegate _handler; | ||
|
||
public AccurateTimer(Action action, int delay) | ||
{ | ||
_action = action; | ||
Winmm.timeBeginPeriod(1); | ||
_handler = new Winmm.TimerEventDelegate(TimerCallback); | ||
_timerId = Winmm.timeSetEvent(delay, 0, _handler, IntPtr.Zero, Constants.EVENT_TYPE); | ||
} | ||
|
||
public void Stop() | ||
{ | ||
Winmm.timeKillEvent(_timerId); | ||
Winmm.timeEndPeriod(1); | ||
Thread.Sleep(100); | ||
} | ||
|
||
private void TimerCallback(int id, int msg, IntPtr user, int dw1, int dw2) | ||
{ | ||
if (_timerId != 0) | ||
{ | ||
_action(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
<supportedRuntime version="v4.0" /> | ||
</startup> | ||
</configuration> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.