mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Removed not used gif class
This commit is contained in:
parent
d7ae4c4571
commit
e097bee7dc
8 changed files with 8 additions and 141 deletions
|
@ -20,7 +20,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using Greenshot.Core;
|
using Greenshot.Core;
|
||||||
using Greenshot.IniFile;
|
|
||||||
using GreenshotPlugin.UnmanagedHelpers;
|
using GreenshotPlugin.UnmanagedHelpers;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
@ -96,28 +96,28 @@ private void InitializeComponent()
|
||||||
this.btnCancel = new System.Windows.Forms.Button();
|
this.btnCancel = new System.Windows.Forms.Button();
|
||||||
this.txtInputText = new System.Windows.Forms.TextBox();
|
this.txtInputText = new System.Windows.Forms.TextBox();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// btnOK
|
// btnOK
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.btnOK, "btnOK");
|
resources.ApplyResources(this.btnOK, "btnOK");
|
||||||
this.btnOK.Name = "btnOK";
|
this.btnOK.Name = "btnOK";
|
||||||
this.btnOK.UseVisualStyleBackColor = true;
|
this.btnOK.UseVisualStyleBackColor = true;
|
||||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||||
//
|
//
|
||||||
// btnCancel
|
// btnCancel
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.btnCancel, "btnCancel");
|
resources.ApplyResources(this.btnCancel, "btnCancel");
|
||||||
this.btnCancel.Name = "btnCancel";
|
this.btnCancel.Name = "btnCancel";
|
||||||
this.btnCancel.UseVisualStyleBackColor = true;
|
this.btnCancel.UseVisualStyleBackColor = true;
|
||||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||||
//
|
//
|
||||||
// txtInputText
|
// txtInputText
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.txtInputText, "txtInputText");
|
resources.ApplyResources(this.txtInputText, "txtInputText");
|
||||||
this.txtInputText.Name = "txtInputText";
|
this.txtInputText.Name = "txtInputText";
|
||||||
//
|
//
|
||||||
// InputBox
|
// InputBox
|
||||||
//
|
//
|
||||||
this.AcceptButton = this.btnOK;
|
this.AcceptButton = this.btnOK;
|
||||||
resources.ApplyResources(this, "$this");
|
resources.ApplyResources(this, "$this");
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
@ -132,7 +132,6 @@ private void InitializeComponent()
|
||||||
this.Shown += new System.EventHandler(this.InputBox_Shown);
|
this.Shown += new System.EventHandler(this.InputBox_Shown);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private System.Windows.Forms.Button btnOK;
|
private System.Windows.Forms.Button btnOK;
|
||||||
|
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -192,7 +192,6 @@
|
||||||
<Compile Include="Forms\TrayForm.cs">
|
<Compile Include="Forms\TrayForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GIF\AnimatedGif.cs" />
|
|
||||||
<Compile Include="Helpers\CaptureHelpers.cs" />
|
<Compile Include="Helpers\CaptureHelpers.cs" />
|
||||||
<Compile Include="CLI\CLICommand.cs" />
|
<Compile Include="CLI\CLICommand.cs" />
|
||||||
<Compile Include="CLI\CLICommandAction.cs" />
|
<Compile Include="CLI\CLICommandAction.cs" />
|
||||||
|
|
|
@ -30,7 +30,6 @@ You should have received a copy of the GNU General Public License
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Design;
|
using System.Drawing.Design;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Drawing.Text;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace ImageEffectsLib
|
namespace ImageEffectsLib
|
||||||
|
|
|
@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
|
||||||
#endregion License Information (GPL v3)
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
using HelpersLib;
|
using HelpersLib;
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
|
@ -27,7 +27,6 @@ You should have received a copy of the GNU General Public License
|
||||||
using SingleInstanceApplication;
|
using SingleInstanceApplication;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
|
@ -23,11 +23,7 @@ You should have received a copy of the GNU General Public License
|
||||||
|
|
||||||
#endregion License Information (GPL v3)
|
#endregion License Information (GPL v3)
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace UploadersLib.ImageUploaders
|
namespace UploadersLib.ImageUploaders
|
||||||
|
|
Loading…
Reference in a new issue