Skip to content
Snippets Groups Projects
Commit 824be7da authored by Riley Mcgee's avatar Riley Mcgee
Browse files

Merge remote-tracking branch 'origin'

parents 2ca4e86a 666bd24e
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,27 @@ namespace Gifitti.Transformation
for (int i = 0; i < gm.numberOfFrames; i++)
{
collection.Add(new MagickImage(gm.GetFrame(i) as Bitmap));
//collection[i].AnimationDelay = (delay / 8);
collection[i].Resize(newWidth, newHeight);
gm.SetFrameFromImage(collection[i].ToBitmap(), i);
}
}
}
public static void saveThePlayback(GifModel gm, int delay)
{
using (MagickImageCollection collection = new MagickImageCollection())
{
for (int i = 0; i < gm.numberOfFrames; i++)
{
collection.Add(new MagickImage(gm.GetFrame(i) as Bitmap));
collection[i].AnimationDelay = (delay/10);
}
//return collection;
collection.Write("Test.Animated.gif");
}
}
}
}
......@@ -11,6 +11,8 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Gifitti.Models;
using System.Threading;
using Gifitti.Transformation;
using ImageMagick;
namespace Gifitti.View_Models
{
......@@ -207,13 +209,13 @@ namespace Gifitti.View_Models
/// <param name="e"> Event arguments associated with this event. </param>
private void MenuItemFileSaveAs(object sender, EventArgs e)
{
if (!chkImage())
TransformGif.saveThePlayback(gm, delay);
/*if (!chkImage())
return;
String path = null;
saveGifFileDialog.Filter = "GIF Files|*.gif";
if (saveGifFileDialog.ShowDialog() == DialogResult.OK)
path = saveGifFileDialog.FileName;
//Handel Close
if (path == null)
return;
......@@ -225,6 +227,7 @@ namespace Gifitti.View_Models
{
MessageBox.Show("Save Path Invalid!");
}
*/
}
#endregion
......@@ -327,5 +330,7 @@ namespace Gifitti.View_Models
{
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment