From e097bee7dc419e1ef6f51263586d2f080e1b6feb Mon Sep 17 00:00:00 2001 From: Jaex Date: Wed, 8 Oct 2014 22:56:40 +0300 Subject: [PATCH] Removed not used gif class --- GreenshotImageEditor/Core/ImageHelper.cs | 1 - HelpersLib/Forms/InputBox.cs | 17 ++- HelpersLib/GIF/AnimatedGif.cs | 123 ---------------------- HelpersLib/HelpersLib.csproj | 1 - ImageEffectsLib/Drawings/DrawText.cs | 1 - ShareX/LanguageHelper.cs | 1 - ShareX/Program.cs | 1 - UploadersLib/ImageUploaders/HizliResim.cs | 4 - 8 files changed, 8 insertions(+), 141 deletions(-) delete mode 100644 HelpersLib/GIF/AnimatedGif.cs diff --git a/GreenshotImageEditor/Core/ImageHelper.cs b/GreenshotImageEditor/Core/ImageHelper.cs index c465c6f2c..639918a05 100644 --- a/GreenshotImageEditor/Core/ImageHelper.cs +++ b/GreenshotImageEditor/Core/ImageHelper.cs @@ -20,7 +20,6 @@ */ using Greenshot.Core; -using Greenshot.IniFile; using GreenshotPlugin.UnmanagedHelpers; using System; using System.Collections.Generic; diff --git a/HelpersLib/Forms/InputBox.cs b/HelpersLib/Forms/InputBox.cs index 49d8e42d2..f222ca68d 100644 --- a/HelpersLib/Forms/InputBox.cs +++ b/HelpersLib/Forms/InputBox.cs @@ -96,28 +96,28 @@ private void InitializeComponent() this.btnCancel = new System.Windows.Forms.Button(); this.txtInputText = new System.Windows.Forms.TextBox(); this.SuspendLayout(); - // + // // btnOK - // + // resources.ApplyResources(this.btnOK, "btnOK"); this.btnOK.Name = "btnOK"; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // + // // btnCancel - // + // resources.ApplyResources(this.btnCancel, "btnCancel"); this.btnCancel.Name = "btnCancel"; this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // + // // txtInputText - // + // resources.ApplyResources(this.txtInputText, "txtInputText"); this.txtInputText.Name = "txtInputText"; - // + // // InputBox - // + // this.AcceptButton = this.btnOK; resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; @@ -132,7 +132,6 @@ private void InitializeComponent() this.Shown += new System.EventHandler(this.InputBox_Shown); this.ResumeLayout(false); this.PerformLayout(); - } private System.Windows.Forms.Button btnOK; diff --git a/HelpersLib/GIF/AnimatedGif.cs b/HelpersLib/GIF/AnimatedGif.cs deleted file mode 100644 index 93a3ca1ee..000000000 --- a/HelpersLib/GIF/AnimatedGif.cs +++ /dev/null @@ -1,123 +0,0 @@ -#region License Information (GPL v3) - -/* - ShareX - A program that allows you to take screenshots and share any file type - Copyright (C) 2007-2014 ShareX Developers - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - Optionally you can also view the license at . -*/ - -#endregion License Information (GPL v3) - -using System; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; - -namespace HelpersLib -{ - public class AnimatedGif : IDisposable - { - private byte[] buf1, buf2, buf3; - private MemoryStream gifStream; - private BinaryWriter binaryWriter; - private int frameNum; - - public AnimatedGif(int delay, int repeat = 0) - { - buf2 = new byte[19]; - buf2[0] = 0x21; // Extension introducer - buf2[1] = 0xFF; // Application extension - buf2[2] = 0x0B; // Size of block - buf2[3] = 78; // N - buf2[4] = 69; // E - buf2[5] = 84; // T - buf2[6] = 83; // S - buf2[7] = 67; // C - buf2[8] = 65; // A - buf2[9] = 80; // P - buf2[10] = 69; // E - buf2[11] = 50; // 2 - buf2[12] = 46; // . - buf2[13] = 48; // 0 - buf2[14] = 0x03; // Size of block - buf2[15] = 0x01; // Loop indicator - buf2[16] = (byte)(repeat % 0x100); // Number of repetitions - buf2[17] = (byte)(repeat / 0x100); // 0 for endless loop - buf2[18] = 0x00; // Block terminator - - buf3 = new byte[8]; - buf3[0] = 0x21; // Extension introducer - buf3[1] = 0xF9; // Graphic control extension - buf3[2] = 0x04; // Size of block - buf3[3] = 0x09; // Flags: reserved, disposal method, user input, transparent color - buf3[4] = (byte)(delay / 10 % 0x100); // Delay time low byte - buf3[5] = (byte)(delay / 10 / 0x100); // Delay time high byte - buf3[6] = 0xFF; // Transparent color index - buf3[7] = 0x00; // Block terminator - - gifStream = new MemoryStream(); - binaryWriter = new BinaryWriter(gifStream); - } - - public void AddFrame(Image img) - { - using (MemoryStream ms = new MemoryStream()) - { - img.Save(ms, ImageFormat.Gif); - buf1 = ms.ToArray(); - } - - if (frameNum == 0) - { - // only write these the first time - binaryWriter.Write(buf1, 0, 781); // Header & global color table - binaryWriter.Write(buf2, 0, 19); // Application extension - } - - binaryWriter.Write(buf3, 0, 8); // Graphic extension - binaryWriter.Write(buf1, 789, buf1.Length - 790); // Image data - - frameNum++; - } - - public void AddFrame(string path) - { - using (Image img = ImageHelpers.LoadImage(path)) - { - AddFrame(img); - } - } - - public void Finish() - { - // only write this one the last time - binaryWriter.Write(59); // Image terminator - } - - public void Save(string filePath) - { - gifStream.WriteToFile(filePath); - } - - public void Dispose() - { - if (gifStream != null) gifStream.Dispose(); - if (binaryWriter != null) binaryWriter.Close(); - } - } -} \ No newline at end of file diff --git a/HelpersLib/HelpersLib.csproj b/HelpersLib/HelpersLib.csproj index a6ea0fcb7..9428d6afe 100644 --- a/HelpersLib/HelpersLib.csproj +++ b/HelpersLib/HelpersLib.csproj @@ -192,7 +192,6 @@ Form - diff --git a/ImageEffectsLib/Drawings/DrawText.cs b/ImageEffectsLib/Drawings/DrawText.cs index 302edd264..a30cea82e 100644 --- a/ImageEffectsLib/Drawings/DrawText.cs +++ b/ImageEffectsLib/Drawings/DrawText.cs @@ -30,7 +30,6 @@ using System.Drawing; using System.Drawing.Design; using System.Drawing.Drawing2D; -using System.Drawing.Text; using System.Linq; namespace ImageEffectsLib diff --git a/ShareX/LanguageHelper.cs b/ShareX/LanguageHelper.cs index 9808e728d..c1ec06674 100644 --- a/ShareX/LanguageHelper.cs +++ b/ShareX/LanguageHelper.cs @@ -24,7 +24,6 @@ #endregion License Information (GPL v3) using HelpersLib; -using System; using System.ComponentModel; using System.Globalization; using System.Threading; diff --git a/ShareX/Program.cs b/ShareX/Program.cs index bb34b53e7..0e1a2432b 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -27,7 +27,6 @@ using SingleInstanceApplication; using System; using System.Diagnostics; -using System.Globalization; using System.IO; using System.Reflection; using System.Text; diff --git a/UploadersLib/ImageUploaders/HizliResim.cs b/UploadersLib/ImageUploaders/HizliResim.cs index b66b9e64f..6fa9ddaf0 100644 --- a/UploadersLib/ImageUploaders/HizliResim.cs +++ b/UploadersLib/ImageUploaders/HizliResim.cs @@ -23,11 +23,7 @@ #endregion License Information (GPL v3) -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using System.Text.RegularExpressions; namespace UploadersLib.ImageUploaders