Skip to content

Commit

Permalink
show live video also when not tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicMau committed Nov 21, 2018
1 parent 2cb0ce0 commit cae1e63
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
8 changes: 8 additions & 0 deletions KinectHeadtracker/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 18 additions & 9 deletions KinectHeadtracker/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ private void Tracker_OnReceiveData(double x, double y, double z, double yaw, dou
lblYaw.Text = yaw.ToString();
lblPitch.Text = pitch.ToString();
lblRoll.Text = roll.ToString();

if (cbxLiveVideo.Checked)
{
picLiveVideo.Image = tracker.GetImage();
}
else
{
picLiveVideo.Image = null;
}
}
}));
}
Expand Down Expand Up @@ -105,9 +96,27 @@ private void Timer1_Tick(object sender, EventArgs e)
// we haven't received any data for five minutes. Let's call it quits
cbxEnabled.Checked = false;
timer1.Enabled = false;
timer2.Enabled = false;
tracker.Stop();
}
}
}

private void timer2_Tick(object sender, EventArgs e)
{
if (cbxLiveVideo.Checked)
{
picLiveVideo.Image = tracker.GetImage();
}
else
{
picLiveVideo.Image = null;
}
}

private void cbxLiveVideo_CheckedChanged(object sender, EventArgs e)
{
timer2.Enabled = cbxLiveVideo.Checked;
}
}
}
3 changes: 3 additions & 0 deletions KinectHeadtracker/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>104, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down

0 comments on commit cae1e63

Please sign in to comment.