From 40d849f80151bbb1f98b0f40fe7dd7e62c208243 Mon Sep 17 00:00:00 2001 From: Nicolai Kozel <kozeln@mcmaster.ca> Date: Tue, 15 Nov 2016 12:15:47 -0500 Subject: [PATCH] nuking project because of odd fatal issue --- .gitattributes | 63 ++++++++++ src/Gifitti/Gifitti.sln | 10 +- ...MainForm.Designer.cs => Form1.Designer.cs} | 54 +++------ src/Gifitti/Gifitti/Form1.cs | 35 ++++++ .../{Views/MainForm.resx => Form1.resx} | 6 - .../Gifitti/GifImageModule/GifImage.cs | 82 ------------- .../Gifitti/GifImageModule/GifModel.cs | 108 ------------------ src/Gifitti/Gifitti/Gifitti.csproj | 31 +---- src/Gifitti/Gifitti/Program.cs | 8 +- .../Gifitti/Properties/AssemblyInfo.cs | 2 +- src/Gifitti/Gifitti/Views/MainForm.cs | 105 ----------------- src/Gifitti/Gifitti/packages.config | 4 - 12 files changed, 125 insertions(+), 383 deletions(-) create mode 100644 .gitattributes rename src/Gifitti/Gifitti/{Views/MainForm.Designer.cs => Form1.Designer.cs} (55%) create mode 100644 src/Gifitti/Gifitti/Form1.cs rename src/Gifitti/Gifitti/{Views/MainForm.resx => Form1.resx} (93%) delete mode 100644 src/Gifitti/Gifitti/GifImageModule/GifImage.cs delete mode 100644 src/Gifitti/Gifitti/GifImageModule/GifModel.cs delete mode 100644 src/Gifitti/Gifitti/Views/MainForm.cs delete mode 100644 src/Gifitti/Gifitti/packages.config diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/src/Gifitti/Gifitti.sln b/src/Gifitti/Gifitti.sln index 87ac6a5..b820fcf 100644 --- a/src/Gifitti/Gifitti.sln +++ b/src/Gifitti/Gifitti.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gifitti", "Gifitti\Gifitti.csproj", "{436EBE81-2B19-4675-9DB1-7A38E6B1C98F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gifitti", "Gifitti\Gifitti.csproj", "{07513F6B-9A44-4981-A3F9-8882AC8B890E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {436EBE81-2B19-4675-9DB1-7A38E6B1C98F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {436EBE81-2B19-4675-9DB1-7A38E6B1C98F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {436EBE81-2B19-4675-9DB1-7A38E6B1C98F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {436EBE81-2B19-4675-9DB1-7A38E6B1C98F}.Release|Any CPU.Build.0 = Release|Any CPU + {07513F6B-9A44-4981-A3F9-8882AC8B890E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07513F6B-9A44-4981-A3F9-8882AC8B890E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07513F6B-9A44-4981-A3F9-8882AC8B890E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07513F6B-9A44-4981-A3F9-8882AC8B890E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Gifitti/Gifitti/Views/MainForm.Designer.cs b/src/Gifitti/Gifitti/Form1.Designer.cs similarity index 55% rename from src/Gifitti/Gifitti/Views/MainForm.Designer.cs rename to src/Gifitti/Gifitti/Form1.Designer.cs index 058b950..2a7645f 100644 --- a/src/Gifitti/Gifitti/Views/MainForm.Designer.cs +++ b/src/Gifitti/Gifitti/Form1.Designer.cs @@ -1,8 +1,7 @@ -namespace Gifitti.Views +namespace Gifitti { - partial class MainForm + partial class Form1 { - /// <summary> /// Required designer variable. /// </summary> @@ -30,63 +29,42 @@ private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); - this.gifView = new System.Windows.Forms.PictureBox(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); this.button2 = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.gifView)).BeginInit(); this.SuspendLayout(); // // button1 // this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button1.Location = new System.Drawing.Point(9, 324); - this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); + this.button1.Location = new System.Drawing.Point(12, 506); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(56, 34); + this.button1.Size = new System.Drawing.Size(139, 35); this.button1.TabIndex = 0; - this.button1.Text = "Open"; + this.button1.Text = "Open GIF"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // - // gifView - // - this.gifView.Location = new System.Drawing.Point(9, 10); - this.gifView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.gifView.Name = "gifView"; - this.gifView.Size = new System.Drawing.Size(456, 310); - this.gifView.TabIndex = 1; - this.gifView.TabStop = false; - // - // openFileDialog1 - // - this.openFileDialog1.FileName = "openFileDialog1"; - // // button2 // this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button2.Location = new System.Drawing.Point(406, 325); + this.button2.Location = new System.Drawing.Point(431, 506); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(56, 34); - this.button2.TabIndex = 2; - this.button2.Text = "Save Frames"; + this.button2.Size = new System.Drawing.Size(139, 35); + this.button2.TabIndex = 1; + this.button2.Text = "Save GIF"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // Form1 // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(474, 368); + this.ClientSize = new System.Drawing.Size(582, 553); this.Controls.Add(this.button2); - this.Controls.Add(this.gifView); this.Controls.Add(this.button1); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.MaximizeBox = false; - this.Name = "MainForm"; + this.Name = "Form1"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "MainForm"; - ((System.ComponentModel.ISupportInitialize)(this.gifView)).EndInit(); + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); } @@ -94,11 +72,7 @@ #endregion private System.Windows.Forms.Button button1; - private System.Windows.Forms.PictureBox gifView; - private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; private System.Windows.Forms.Button button2; } - } diff --git a/src/Gifitti/Gifitti/Form1.cs b/src/Gifitti/Gifitti/Form1.cs new file mode 100644 index 0000000..89041a5 --- /dev/null +++ b/src/Gifitti/Gifitti/Form1.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Gifitti +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + + } + + private void button2_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/src/Gifitti/Gifitti/Views/MainForm.resx b/src/Gifitti/Gifitti/Form1.resx similarity index 93% rename from src/Gifitti/Gifitti/Views/MainForm.resx rename to src/Gifitti/Gifitti/Form1.resx index 4f7bdfb..1af7de1 100644 --- a/src/Gifitti/Gifitti/Views/MainForm.resx +++ b/src/Gifitti/Gifitti/Form1.resx @@ -117,10 +117,4 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> - <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>157, 17</value> - </metadata> </root> \ No newline at end of file diff --git a/src/Gifitti/Gifitti/GifImageModule/GifImage.cs b/src/Gifitti/Gifitti/GifImageModule/GifImage.cs deleted file mode 100644 index 96e7f48..0000000 --- a/src/Gifitti/Gifitti/GifImageModule/GifImage.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Imaging; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Gifitti.GifImageModule -{ - public class GifImage - { - public Image gifImage - { - get; set; - } - private FrameDimension dimension; - private int frameCount; - private int currentFrame = -1; - private bool reverse; - private int step = 1; - - public GifImage(string path) - { - gifImage = Image.FromFile(path); - //initialize - dimension = new FrameDimension(gifImage.FrameDimensionsList[0]); - //gets the GUID - //total frames in the animation - frameCount = gifImage.GetFrameCount(dimension); - } - - private void modifyGifImage(Image gif) - { - gifImage = gif; - //initialize - dimension = new FrameDimension(gifImage.FrameDimensionsList[0]); - //gets the GUID - //total frames in the animation - frameCount = gifImage.GetFrameCount(dimension); - } - - public bool ReverseAtEnd - { - //whether the gif should play backwards when it reaches the end - get { return reverse; } - set { reverse = value; } - } - - public Image GetNextFrame() - { - - currentFrame += step; - - //if the animation reaches a boundary... - if (currentFrame >= frameCount || currentFrame < 1) - { - if (reverse) - { - step *= -1; - //...reverse the count - //apply it - currentFrame += step; - } - else - { - currentFrame = 0; - //...or start over - } - } - return GetFrame(currentFrame); - } - - public Image GetFrame(int index) - { - gifImage.SelectActiveFrame(dimension, index); - //find the frame - return (Image)gifImage.Clone(); - //return a copy of it - } - } -} diff --git a/src/Gifitti/Gifitti/GifImageModule/GifModel.cs b/src/Gifitti/Gifitti/GifImageModule/GifModel.cs deleted file mode 100644 index 17f199e..0000000 --- a/src/Gifitti/Gifitti/GifImageModule/GifModel.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Windows.Media.Imaging; -using System.Windows.Media; -using ImageMagick; - -namespace Gifitti.GifImageModule -{ - public class GifModel - { - public GifImage gifImage { get; private set; } - public Image originalGif { get; private set; } - private int numberOfFrames; - private Image[] frames; - - //Build a Gif Model instace - //Re create object when a new gif is loaded - //Keep when working with same gif - public GifModel(GifImage gifImage) - { - this.gifImage = gifImage; - //Save the original Gif - originalGif = this.gifImage.gifImage.Clone() as Image; - frameConstruction(this.gifImage); - } - - public GifModel(String path) - { - this.gifImage = new GifImage(path); - //Save the original Gif - originalGif = this.gifImage.gifImage.Clone() as Image; - frameConstruction(this.gifImage); - } - - //Construct Frames for the entire Image - private void frameConstruction(GifImage gifImage) - { - numberOfFrames = gifImage.gifImage.GetFrameCount(FrameDimension.Time); - frames = new Image[numberOfFrames]; - - for (int i = 0; i < numberOfFrames; i++) - { - originalGif.SelectActiveFrame(FrameDimension.Time, i); - frames[i] = originalGif.Clone() as Image; - } - } - - public void resetToOriginalGif() - { - gifImage.gifImage = originalGif; - } - - - public void resizeGif(int newWidth, int newHeight) - { - using (MagickImageCollection collection = new MagickImageCollection()) - { - for (int i = 0; i < frames.Length; i++) - { - collection.Add(new MagickImage(frames[i] as Bitmap)); - collection[i].Resize(newWidth, newHeight); - } - // Optionally reduce colors - QuantizeSettings settings = new QuantizeSettings(); - settings.Colors = 256; - collection.Quantize(settings); - - // Optionally optimize the images (images should have the same size). - collection.Optimize(); - - // Save gif - collection.Write("tempResize.gif"); - } - - - - } - - public void returnSubGif(int start, int stop) - { - using (MagickImageCollection collection = new MagickImageCollection()) - { - // Add first image and set the animation delay to 100ms - for (int i = start; i < stop; i++) - { - collection.Add(new ImageMagick.MagickImage(frames[i] as Bitmap)); - collection[i - start].AnimationDelay = 1; - } - // Optionally reduce colors - QuantizeSettings settings = new QuantizeSettings(); - settings.Colors = 256; - collection.Quantize(settings); - - // Optionally optimize the images (images should have the same size). - collection.Optimize(); - - // Save gif - collection.Write("temp.gif"); - } - } - } -} diff --git a/src/Gifitti/Gifitti/Gifitti.csproj b/src/Gifitti/Gifitti/Gifitti.csproj index 1716f8f..b59a4c3 100644 --- a/src/Gifitti/Gifitti/Gifitti.csproj +++ b/src/Gifitti/Gifitti/Gifitti.csproj @@ -4,7 +4,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProjectGuid>{436EBE81-2B19-4675-9DB1-7A38E6B1C98F}</ProjectGuid> + <ProjectGuid>{07513F6B-9A44-4981-A3F9-8882AC8B890E}</ProjectGuid> <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Gifitti</RootNamespace> @@ -12,8 +12,6 @@ <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> - <NuGetPackageImportStamp> - </NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -24,7 +22,6 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> @@ -36,11 +33,6 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Magick.NET-Q16-AnyCPU, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL"> - <HintPath>..\packages\Magick.NET-Q16-AnyCPU.7.0.3.300\lib\net40-client\Magick.NET-Q16-AnyCPU.dll</HintPath> - <Private>True</Private> - </Reference> - <Reference Include="PresentationCore" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> @@ -52,21 +44,18 @@ <Reference Include="System.Net.Http" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="WindowsBase" /> </ItemGroup> <ItemGroup> - <Compile Include="GifImageModule\GifModel.cs" /> - <Compile Include="Views\MainForm.cs"> + <Compile Include="Form1.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="Views\MainForm.Designer.cs"> - <DependentUpon>MainForm.cs</DependentUpon> + <Compile Include="Form1.Designer.cs"> + <DependentUpon>Form1.cs</DependentUpon> </Compile> - <Compile Include="GifImageModule\GifImage.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <EmbeddedResource Include="Views\MainForm.resx"> - <DependentUpon>MainForm.cs</DependentUpon> + <EmbeddedResource Include="Form1.resx"> + <DependentUpon>Form1.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> @@ -77,7 +66,6 @@ <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> </Compile> - <None Include="packages.config" /> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> @@ -92,13 +80,6 @@ <None Include="App.config" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <Import Project="..\packages\Magick.NET-Q16-x86.7.0.3.300\build\net40-client\Magick.NET-Q16-x86.targets" Condition="Exists('..\packages\Magick.NET-Q16-x86.7.0.3.300\build\net40-client\Magick.NET-Q16-x86.targets')" /> - <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> - <PropertyGroup> - <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> - </PropertyGroup> - <Error Condition="!Exists('..\packages\Magick.NET-Q16-x86.7.0.3.300\build\net40-client\Magick.NET-Q16-x86.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Magick.NET-Q16-x86.7.0.3.300\build\net40-client\Magick.NET-Q16-x86.targets'))" /> - </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> diff --git a/src/Gifitti/Gifitti/Program.cs b/src/Gifitti/Gifitti/Program.cs index c9dbe6f..ed285ea 100644 --- a/src/Gifitti/Gifitti/Program.cs +++ b/src/Gifitti/Gifitti/Program.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; -using Gifitti.Views; namespace Gifitti { @@ -17,12 +16,7 @@ namespace Gifitti { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - /* - GifImageModule.GifModel gm = new GifImageModule.GifModel("C:/Users/riley_000/Desktop/GIFS/giphy.gif"); - gm.resizeGif(700, 700); - gm.returnSubGif(0,10); - */ + Application.Run(new Form1()); } } } diff --git a/src/Gifitti/Gifitti/Properties/AssemblyInfo.cs b/src/Gifitti/Gifitti/Properties/AssemblyInfo.cs index 2e58694..8208d4e 100644 --- a/src/Gifitti/Gifitti/Properties/AssemblyInfo.cs +++ b/src/Gifitti/Gifitti/Properties/AssemblyInfo.cs @@ -20,7 +20,7 @@ using System.Runtime.InteropServices; [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("436ebe81-2b19-4675-9db1-7a38e6b1c98f")] +[assembly: Guid("07513f6b-9a44-4981-a3f9-8882ac8b890e")] // Version information for an assembly consists of the following four values: // diff --git a/src/Gifitti/Gifitti/Views/MainForm.cs b/src/Gifitti/Gifitti/Views/MainForm.cs deleted file mode 100644 index fd5bd0a..0000000 --- a/src/Gifitti/Gifitti/Views/MainForm.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Gifitti.GifImageModule; - -namespace Gifitti.Views -{ - public partial class MainForm : Form - { - GifModel gm; - - // GifImage _currentGif; <- used to encapsulate info later - private const int widthBuffer = 20; - private const int heightBuffer = 60; - Image globalGif; - - public MainForm() - { - - InitializeComponent(); - } - - private void button1_Click(object sender, EventArgs e) - { - openFileDialog1.Filter = "GIF Files|*.gif"; - DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog. - if (result == DialogResult.OK) // Test result. - { - string file = openFileDialog1.FileName; - try - { - - - gm = new GifModel(file); - Image loadedGif = gm.gifImage.gifImage; - globalGif = loadedGif; - gifView.Image = loadedGif; - - gifView.Width = loadedGif.Width; - gifView.Height = loadedGif.Height; - ClientSize = new Size(loadedGif.Width+widthBuffer, loadedGif.Height+heightBuffer); - } - - catch (IOException) - { - } - - CenterToScreen(); - - // Focus the gif: - gifView.Select(); - gifView.Focus(); - ActiveControl = gifView; - } - } - - - private void button2_Click(object sender, EventArgs e) - { - String x = ""; - if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) - { - x = folderBrowserDialog1.SelectedPath; - } - - List<Image> IMGs = new List<Image>(); - Image test; - int Length = globalGif.GetFrameCount(FrameDimension.Time); - - for (int i = 0; i < Length; i++) - { - globalGif.SelectActiveFrame(FrameDimension.Time, i); - test = new Bitmap(globalGif); - String y = "\\tmp-" + i + ".bmp"; - String xy = x + y; - test.Save(@xy); - - } - } - - private void Form1_Load(object sender, EventArgs e) - { - - } - - private void gifView_Click(object sender, EventArgs e) - { - - } - - private void button3_Click(object sender, EventArgs e) - { - gm?.returnSubGif(1,10); - - } - } -} diff --git a/src/Gifitti/Gifitti/packages.config b/src/Gifitti/Gifitti/packages.config deleted file mode 100644 index 9ef2f2a..0000000 --- a/src/Gifitti/Gifitti/packages.config +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<packages> - <package id="Magick.NET-Q16-AnyCPU" version="7.0.3.300" targetFramework="net452" /> -</packages> \ No newline at end of file -- GitLab