Skip to content

Commit

Permalink
Player animations
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Jul 1, 2012
1 parent 3b86a5d commit e56ec40
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions DeRez/Form1.Designer.cs

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

19 changes: 19 additions & 0 deletions DeRez/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,24 @@ private void animationSpeedTrackBar_Scroll(object sender, EventArgs e) {
_animationSpeed = animationSpeedTrackBar.Value;
}

private void button1_Click(object sender, EventArgs e) {
folderBrowserDialog1.ShowDialog();
string selectedPath = folderBrowserDialog1.SelectedPath;
ExportImages(selectedPath);
}

private void ExportImages(string selectedPath) {
_timer.Stop();
for ( int i = 0; i <= _numFrames; i++ ) {
float percent = i / (float) _numFrames;
Console.WriteLine("Exporting frame at {0}", percent);
_image = FrameGrabber.GetFrameFromVideo(_animationPath, percent);
src.Image = _image;
DeRez();
string fileName = String.Format("{0}/{1:0000}.png", selectedPath, i) ;
dest.Image.Save(fileName);
}
_timer.Start();
}
}
}
3 changes: 3 additions & 0 deletions DeRez/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,7 @@
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>186, 17</value>
</metadata>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>326, 17</value>
</metadata>
</root>

0 comments on commit e56ec40

Please sign in to comment.