Introduction
using your webcam for slideshow presentation, you can slide forward and backward using laser gesture, by moving it from left to right or vice versa.
Codesnipt:
private void ControlPowerPoint(string gesture)
{
IntPtr powerPointHandle = FindWindow(null, "PowerPoint Slide Show - ["+slideName+"]");
if (powerPointHandle == IntPtr.Zero)
{
System.Windows.Forms.MessageBox.Show("Slide Show not running");
return;
}
switch (gesture)
{
case "LEFT":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("p");
Beeper.RecognizedBeep();
break;
case "RIGHT":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("n");
Beeper.RecognizedBeep();
break;
case "DIAGONAL2B":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("n");
Beeper.RecognizedBeep();
break;
case "DIAGONAL1A":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("n");
Beeper.RecognizedBeep();
break;
case "DIAGONAL1B":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("P");
Beeper.RecognizedBeep();
break;
case "DIAGONAL2A":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("P");
Beeper.RecognizedBeep();
break;
case "UP":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("n");
Beeper.RecognizedBeep();
break;
case "DOWN":
SetForegroundWindow(powerPointHandle);
SendKeys.SendWait("p");
Beeper.RecognizedBeep();
break;
}
}
its really fun that you can talk to the windows applications and command them with your application whatever was the method to do that but i like it ..
Video Demo:
http://www.youtube.com/watch?v=eEsMmbY8Lcc
Finally:
I would like to thank Ashish Derhgawen for his project Laser Gesture,though thanks for Andrew Kirillov for the Motion Detection Algorithms.