mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
More SF references removed
This commit is contained in:
parent
ea6d5ee2f2
commit
5854c771bd
28 changed files with 10 additions and 1501 deletions
|
@ -1,38 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace Greenshot.Helpers {
|
|
||||||
public class SpecialFolderPatternConverter : log4net.Util.PatternConverter {
|
|
||||||
protected override void Convert(System.IO.TextWriter writer, object state) {
|
|
||||||
// Making Greenshot portable
|
|
||||||
string pafPath = Path.Combine(Application.StartupPath, @"App\Greenshot");
|
|
||||||
if (Directory.Exists(pafPath)) {
|
|
||||||
writer.Write(Path.Combine(Application.StartupPath, @"Data"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Environment.SpecialFolder specialFolder = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), base.Option, true);
|
|
||||||
writer.Write(Environment.GetFolderPath(specialFolder));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -102,7 +102,7 @@ Detaljer om GNU General Public License:
|
||||||
Ikoner fra Yusuke Kamiyamanes Fugue ikon-sæt (Creative Commons Attribution 3.0 license):
|
Ikoner fra Yusuke Kamiyamanes Fugue ikon-sæt (Creative Commons Attribution 3.0 license):
|
||||||
</resource>
|
</resource>
|
||||||
<resource name="about_host">
|
<resource name="about_host">
|
||||||
Greenshot hostes af sourceforge.net på:
|
Greenshot hostes af GitHub på:
|
||||||
</resource>
|
</resource>
|
||||||
<resource name="about_bugs">
|
<resource name="about_bugs">
|
||||||
Rapporter venligst fejl til:
|
Rapporter venligst fejl til:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<resource name="about_bugs">Lefft was falsch, meldst di hier</resource>
|
<resource name="about_bugs">Lefft was falsch, meldst di hier</resource>
|
||||||
<resource name="about_donations">Wenn der Greenshot gfälld, kannsd uns gern a weng helfn:</resource>
|
<resource name="about_donations">Wenn der Greenshot gfälld, kannsd uns gern a weng helfn:</resource>
|
||||||
<resource name="about_host">Greenshot is a bei sourceforge, und zwa dordn:</resource>
|
<resource name="about_host">Greenshot is a bei GitHub, und zwa dordn:</resource>
|
||||||
<resource name="about_icons">Dei Fuztl-Bildla sin vom Yusuke Kamiyamane's Fugue icon set (Griäidif Gommens Äddribuschn 3.0 Laisns)</resource>
|
<resource name="about_icons">Dei Fuztl-Bildla sin vom Yusuke Kamiyamane's Fugue icon set (Griäidif Gommens Äddribuschn 3.0 Laisns)</resource>
|
||||||
<resource name="about_license">Kobbireid (C) 2007-2012 Domas Braun, Jens Glingen, Robin Grohm
|
<resource name="about_license">Kobbireid (C) 2007-2012 Domas Braun, Jens Glingen, Robin Grohm
|
||||||
A Garandie gibds für Greenshot ned, des kannst vergessn. Greenshot is umsonsd und wennsd mogst, kannsd es a rumreichn.
|
A Garandie gibds für Greenshot ned, des kannst vergessn. Greenshot is umsonsd und wennsd mogst, kannsd es a rumreichn.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<resource name="about_bugs">Palun saatke veateated</resource>
|
<resource name="about_bugs">Palun saatke veateated</resource>
|
||||||
<resource name="about_donations">Greenshoti kasutamismugavust ja arendust saate toetada siin:</resource>
|
<resource name="about_donations">Greenshoti kasutamismugavust ja arendust saate toetada siin:</resource>
|
||||||
<resource name="about_host">Greenshot asub portaalis sourceforge.net</resource>
|
<resource name="about_host">Greenshot asub portaalis GitHub</resource>
|
||||||
<resource name="about_icons">Yusuke Kamiyamane on ikoonide tegija Fugue ikooni paketist (Creative Commons Attribution 3.0 litsents)</resource>
|
<resource name="about_icons">Yusuke Kamiyamane on ikoonide tegija Fugue ikooni paketist (Creative Commons Attribution 3.0 litsents)</resource>
|
||||||
<resource name="about_license">Copyright (C) 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
|
<resource name="about_license">Copyright (C) 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
Greenshot ei paku GARANTIID. See on vabaravaline programm ja Te võite seda levitava vabalt teatud tingimuste alusel.
|
Greenshot ei paku GARANTIID. See on vabaravaline programm ja Te võite seda levitava vabalt teatud tingimuste alusel.
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<resource name="about_bugs">Harap laporkan kesalahan ke</resource>
|
<resource name="about_bugs">Harap laporkan kesalahan ke</resource>
|
||||||
<resource name="about_donations">Jika anda menyukai Greenshot, anda dipersilahkan untuk mendukung kami:</resource>
|
<resource name="about_donations">Jika anda menyukai Greenshot, anda dipersilahkan untuk mendukung kami:</resource>
|
||||||
<resource name="about_host">Greenshot dikelola oleh sourceforge.net di</resource>
|
<resource name="about_host">Greenshot dikelola oleh GitHub di</resource>
|
||||||
<resource name="about_icons">Ikon dari Yusuke Kamiyamane Fugue ikon set (lisensi Creative Commons Attribution 3.0)</resource>
|
<resource name="about_icons">Ikon dari Yusuke Kamiyamane Fugue ikon set (lisensi Creative Commons Attribution 3.0)</resource>
|
||||||
<resource name="about_license">Hak Cipta milik Thomas Braun, Jens Klingen, Robin Krom 2007-2015
|
<resource name="about_license">Hak Cipta milik Thomas Braun, Jens Klingen, Robin Krom 2007-2015
|
||||||
Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.
|
Greenshot comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<resource name="about_bugs">Kļūdu ziņojumus sūtiet uz</resource>
|
<resource name="about_bugs">Kļūdu ziņojumus sūtiet uz</resource>
|
||||||
<resource name="about_donations">Ja Tev patīk „Greenshot”, Tu vari mūs atbalstīt:</resource>
|
<resource name="about_donations">Ja Tev patīk „Greenshot”, Tu vari mūs atbalstīt:</resource>
|
||||||
<resource name="about_host">„Greenshot” atrodams sourceforge.net adresē</resource>
|
<resource name="about_host">„Greenshot” atrodams GitHub adresē</resource>
|
||||||
<resource name="about_icons">Ikonas veidojis Yusuke Kamiyamane's Fugue (Radošās kopienas Atsaucoties 3.0 licence)</resource>
|
<resource name="about_icons">Ikonas veidojis Yusuke Kamiyamane's Fugue (Radošās kopienas Atsaucoties 3.0 licence)</resource>
|
||||||
<resource name="about_license">Autortiesības (C): 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
|
<resource name="about_license">Autortiesības (C): 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
Ņemot vērā, ka „Greenshot” tiek licencēta bez maksas, šai programmai NAV NEKĀDU GARANTIJU. Tu vari to izplatīt un lietot ievērojot GNU Vispārīgo Publisko licenci:</resource>
|
Ņemot vērā, ka „Greenshot” tiek licencēta bez maksas, šai programmai NAV NEKĀDU GARANTIJU. Tu vari to izplatīt un lietot ievērojot GNU Vispārīgo Publisko licenci:</resource>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
<resource name="about_bugs">Napake prosimo javite na</resource>
|
<resource name="about_bugs">Napake prosimo javite na</resource>
|
||||||
<resource name="about_donations">Če vam je Greenshot všeč nas prosim podprite:</resource>
|
<resource name="about_donations">Če vam je Greenshot všeč nas prosim podprite:</resource>
|
||||||
<resource name="about_host">Greenshot gostuje pri sourceforge.net</resource>
|
<resource name="about_host">Greenshot gostuje pri GitHub</resource>
|
||||||
<resource name="about_icons">Ikone: Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license)</resource>
|
<resource name="about_icons">Ikone: Yusuke Kamiyamane's Fugue icon set (Creative Commons Attribution 3.0 license)</resource>
|
||||||
<resource name="about_license">Avtorske pravice (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
|
<resource name="about_license">Avtorske pravice (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
Greenshot absolutno ne ponuja NOBENE GARANCIJE. Program je brezplačen in ga lahko distribuirate pod določenimi pogoji.
|
Greenshot absolutno ne ponuja NOBENE GARANCIJE. Program je brezplačen in ga lahko distribuirate pod določenimi pogoji.
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
Looking for language files for translatabe plugins?
|
|
||||||
Please refer to these:
|
|
||||||
|
|
||||||
* http://greenshot.svn.sourceforge.net/svnroot/greenshot/trunk/GreenshotConfluencePlugin/Languages/
|
|
||||||
* http://greenshot.svn.sourceforge.net/viewvc/greenshot/trunk/GreenshotImgurPlugin/Languages/
|
|
||||||
* http://greenshot.svn.sourceforge.net/viewvc/greenshot/trunk/GreenshotJiraPlugin/Languages/
|
|
||||||
* http://greenshot.svn.sourceforge.net/viewvc/greenshot/trunk/Greenshot-OCR-Plugin/Languages/
|
|
||||||
|
|
||||||
Thanks a lot :)
|
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\CommonProject.properties" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{EFD01BC7-15E5-48AD-BE68-D7B62FEEED2D}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<RootNamespace>GreenshotTest</RootNamespace>
|
|
||||||
<AssemblyName>GreenshotTest</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
|
||||||
<NoStdLib>False</NoStdLib>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<TargetFrameworkProfile />
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="nunit.framework">
|
|
||||||
<HintPath>lib\nunit.framework.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Test\Drawing\Filters\BitmapByteBufferTest.cs" />
|
|
||||||
<Compile Include="Test\Drawing\Properties\PropertyAggregatorTest.cs" />
|
|
||||||
<Compile Include="Test\Helpers\ScaleHelperTest.cs" />
|
|
||||||
<Compile Include="Test\SaveImageFileDialogTest.cs" />
|
|
||||||
<None Include="lib\nunit.framework.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="lib" />
|
|
||||||
<Folder Include="Test" />
|
|
||||||
<Folder Include="Test\Drawing" />
|
|
||||||
<Folder Include="Test\Drawing\Filters" />
|
|
||||||
<Folder Include="Test\Drawing\Properties" />
|
|
||||||
<Folder Include="Test\Helpers" />
|
|
||||||
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
|
|
||||||
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
|
|
||||||
<Name>GreenshotPlugin</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\Greenshot\Greenshot.csproj">
|
|
||||||
<Project>{CD642BF4-D815-4D67-A0B5-C69F0B8231AF}</Project>
|
|
||||||
<Name>Greenshot</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#region Using directives
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("GreenshotTest")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("GreenshotTest")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright 2007-2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// This sets the default COM visibility of types in the assembly to invisible.
|
|
||||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The assembly version has following format :
|
|
||||||
//
|
|
||||||
// Major.Minor.Build.Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can use the default the Revision and
|
|
||||||
// Build Numbers by using the '*' as shown below:
|
|
||||||
[assembly: AssemblyVersion("1.2.0.7")]
|
|
||||||
[assembly: AssemblyInformationalVersion("1.2.0.7-gdb8b2cb")]
|
|
|
@ -1,198 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using NUnit.Framework;
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using Greenshot.Drawing;
|
|
||||||
using Greenshot.Drawing.Filters;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
|
|
||||||
namespace Greenshot.Test.Drawing.Filters {
|
|
||||||
/// <summary>
|
|
||||||
/// Description of BitmapBufferTest.
|
|
||||||
/// </summary>
|
|
||||||
[TestFixture]
|
|
||||||
public class BitmapBufferTest
|
|
||||||
{
|
|
||||||
private Bitmap bmp;
|
|
||||||
private BitmapBuffer buf;
|
|
||||||
private Bitmap bmpRect;
|
|
||||||
private BitmapBuffer bufRect;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[SetUp]
|
|
||||||
public void Init()
|
|
||||||
{
|
|
||||||
bmp = new Bitmap(6,6);
|
|
||||||
for(int i=0; i<6; i++) {
|
|
||||||
int col = 255-i*51;
|
|
||||||
bmp.SetPixel(0,i, Color.FromArgb(col,0,0));
|
|
||||||
bmp.SetPixel(1,i, Color.FromArgb(col,col,0));
|
|
||||||
bmp.SetPixel(2,i, Color.FromArgb(0,col,0));
|
|
||||||
bmp.SetPixel(3,i, Color.FromArgb(0,col,col));
|
|
||||||
bmp.SetPixel(4,i, Color.FromArgb(0,0,col));
|
|
||||||
bmp.SetPixel(5,i, Color.FromArgb(col,0,col));
|
|
||||||
}
|
|
||||||
buf = new BitmapBuffer(bmp);
|
|
||||||
|
|
||||||
bmpRect = new Bitmap(6,6);
|
|
||||||
for(int i=0; i<6; i++) {
|
|
||||||
int col = 255-i*51;
|
|
||||||
bmpRect.SetPixel(0,i, Color.FromArgb(col,0,0));
|
|
||||||
bmpRect.SetPixel(1,i, Color.FromArgb(col,col,0));
|
|
||||||
bmpRect.SetPixel(2,i, Color.FromArgb(0,col,0));
|
|
||||||
bmpRect.SetPixel(3,i, Color.FromArgb(0,col,col));
|
|
||||||
bmpRect.SetPixel(4,i, Color.FromArgb(0,0,col));
|
|
||||||
bmpRect.SetPixel(5,i, Color.FromArgb(col,0,col));
|
|
||||||
}
|
|
||||||
bufRect = new BitmapBuffer(bmpRect,new Rectangle(2,2,2,2));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[TearDown]
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
buf.Dispose();
|
|
||||||
buf = null;
|
|
||||||
bmp.Dispose();
|
|
||||||
bmp = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestGetSetColor()
|
|
||||||
{
|
|
||||||
// Assert.AreEqual(255, buf.R);
|
|
||||||
// Assert.AreEqual(0, buf.G);
|
|
||||||
// Assert.AreEqual(0, buf.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(255,0,0), buf.Color);
|
|
||||||
//
|
|
||||||
// buf.B = 255;
|
|
||||||
// Assert.AreEqual(255, buf.R);
|
|
||||||
// Assert.AreEqual(0, buf.G);
|
|
||||||
// Assert.AreEqual(255, buf.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(255,0,255), buf.Color);
|
|
||||||
//
|
|
||||||
// buf.Color = Color.Red;
|
|
||||||
// Assert.AreEqual(255, buf.R);
|
|
||||||
// Assert.AreEqual(0, buf.G);
|
|
||||||
// Assert.AreEqual(0, buf.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(255,0,0), buf.Color);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestGetSetColorRect()
|
|
||||||
{
|
|
||||||
// Assert.AreEqual(0, bufRect.R);
|
|
||||||
// Assert.AreEqual(153, bufRect.G);
|
|
||||||
// Assert.AreEqual(0, bufRect.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,153,0), bufRect.Color);
|
|
||||||
//
|
|
||||||
// bufRect.B = 255;
|
|
||||||
// Assert.AreEqual(0, bufRect.R);
|
|
||||||
// Assert.AreEqual(153, bufRect.G);
|
|
||||||
// Assert.AreEqual(255, bufRect.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,153,255), bufRect.Color);
|
|
||||||
//
|
|
||||||
// bufRect.Color = Color.FromArgb(0,153,0);
|
|
||||||
// Assert.AreEqual(0, bufRect.R);
|
|
||||||
// Assert.AreEqual(153, bufRect.G);
|
|
||||||
// Assert.AreEqual(0, bufRect.B);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,153,0), bufRect.Color);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestModifyBitmap()
|
|
||||||
{
|
|
||||||
// //buf.MoveTo(0,0);
|
|
||||||
// buf.Color = Color.FromArgb(255,255,255);
|
|
||||||
// buf.Dispose();
|
|
||||||
// buf = new BitmapBuffer(bmp);
|
|
||||||
// Assert.AreEqual(Color.FromArgb(255,255,255), buf.Color);
|
|
||||||
// buf.Color = Color.FromArgb(255,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestTraverse()
|
|
||||||
{
|
|
||||||
/*buf.MoveTo(0,0);
|
|
||||||
buf.Traverse(1,0);
|
|
||||||
Assert.AreEqual(Color.FromArgb(255,255,0), buf.Color);
|
|
||||||
buf.Traverse(0,1);
|
|
||||||
Assert.AreEqual(Color.FromArgb(204,204,0), buf.Color);
|
|
||||||
buf.Traverse(2,2);
|
|
||||||
Assert.AreEqual(Color.FromArgb(0,102,102), buf.Color);
|
|
||||||
buf.MoveTo(4,4);
|
|
||||||
Assert.AreEqual(Color.FromArgb(0,0,51), buf.Color);
|
|
||||||
buf.MoveTo(2,2);
|
|
||||||
Assert.AreEqual(Color.FromArgb(0,153,0), buf.Color);
|
|
||||||
buf.MoveTo(0,0);
|
|
||||||
Assert.AreEqual(Color.FromArgb(255,0,0), buf.Color);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestColorAt(){
|
|
||||||
Assert.AreEqual(Color.FromArgb(255,0,0),buf.GetColorAt(0,0));
|
|
||||||
Assert.AreEqual(Color.FromArgb(255,255,0),buf.GetColorAt(1,0));
|
|
||||||
Assert.AreEqual(Color.FromArgb(204,204,0),buf.GetColorAt(1,1));
|
|
||||||
Assert.AreEqual(Color.FromArgb(0,153,0),buf.GetColorAt(2,2));
|
|
||||||
Assert.AreEqual(Color.FromArgb(204,204,0),buf.GetColorAt(1,1));
|
|
||||||
Assert.AreEqual(Color.FromArgb(0,0,51),buf.GetColorAt(4,4));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestIterate()
|
|
||||||
{
|
|
||||||
// buf.IteratePixel += delegate {
|
|
||||||
// if(buf.Location.X == 0 && buf.Location.Y == 0)
|
|
||||||
// {
|
|
||||||
// Assert.AreEqual(Color.FromArgb(255,0,0), buf.Color);
|
|
||||||
// }
|
|
||||||
// else if(buf.Location.X == 3 && buf.Location.Y == 3)
|
|
||||||
// {
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,102,102), buf.Color);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// buf.Iterate();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestIterateRect()
|
|
||||||
{
|
|
||||||
// bufRect.IteratePixel += delegate {
|
|
||||||
// if(bufRect.Location.X == 0 && bufRect.Location.Y == 0)
|
|
||||||
// {
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,153,0), bufRect.Color);
|
|
||||||
// }
|
|
||||||
// else if(bufRect.Location.X == 1 && bufRect.Location.Y == 0)
|
|
||||||
// {
|
|
||||||
// Assert.AreEqual(Color.FromArgb(0,153,153), bufRect.Color);
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// bufRect.Iterate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using NUnit.Framework;
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Greenshot.Drawing;
|
|
||||||
|
|
||||||
|
|
||||||
using Greenshot.Drawing.Fields;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Greenshot.Test.Drawing.Properties
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Description of PropertyAggregatorTest.
|
|
||||||
/// </summary>
|
|
||||||
[TestFixture]
|
|
||||||
public class PropertyAggregatorTest
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
[SetUp]
|
|
||||||
public void Init()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[TearDown]
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void Test()
|
|
||||||
{
|
|
||||||
|
|
||||||
FieldType t = FieldType.LINE_THICKNESS;
|
|
||||||
|
|
||||||
Surface s = new Surface();
|
|
||||||
FieldAggregator ep = new FieldAggregator();
|
|
||||||
//ep.SetFieldValue(t,598);
|
|
||||||
|
|
||||||
RectangleContainer rc = new RectangleContainer(s);
|
|
||||||
rc.SetFieldValue(t,597);
|
|
||||||
//Assert.AreNotEqual(ep.GetField(t), rc.GetField(t));
|
|
||||||
ep.BindElement(rc);
|
|
||||||
Assert.AreEqual(597, ep.GetField(t).Value);
|
|
||||||
Assert.AreEqual(597, rc.GetField(t).Value);
|
|
||||||
|
|
||||||
RectangleContainer rc2 = new RectangleContainer(s);
|
|
||||||
Assert.AreEqual(597, ep.GetField(t).Value);
|
|
||||||
rc2.SetFieldValue(t,595);
|
|
||||||
Assert.AreEqual(595, rc2.GetField(t).Value);
|
|
||||||
ep.BindElement(rc2);
|
|
||||||
Assert.AreEqual(595, ep.GetField(t).Value);
|
|
||||||
Assert.AreEqual(597, rc.GetField(t).Value);
|
|
||||||
|
|
||||||
RectangleContainer rc3 = new RectangleContainer(s);
|
|
||||||
rc3.SetFieldValue(t,600);
|
|
||||||
ep.BindElement(rc3);
|
|
||||||
|
|
||||||
//Assert.AreEqual(600, ep.GetField(t).Value);
|
|
||||||
Assert.AreEqual(600, rc3.GetField(t).Value);
|
|
||||||
Assert.AreEqual(597, rc.GetField(t).Value);
|
|
||||||
|
|
||||||
ep.SetFieldValue(t, 599);
|
|
||||||
Assert.AreEqual(599, ep.GetField(t).Value);
|
|
||||||
Assert.AreEqual(599, rc.GetField(t).Value);
|
|
||||||
Assert.AreEqual(599, rc2.GetField(t).Value);
|
|
||||||
Assert.AreEqual(599, rc3.GetField(t).Value);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class TestIrrelevantPropertyHolder : RectangleContainer
|
|
||||||
{
|
|
||||||
public TestIrrelevantPropertyHolder() : base(new Surface())
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public int Leet = 1337;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,90 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using NUnit.Framework;
|
|
||||||
using System;
|
|
||||||
using Greenshot.Drawing;
|
|
||||||
using Greenshot.Drawing.Fields;
|
|
||||||
using Greenshot.Drawing.Filters;
|
|
||||||
using Greenshot.Helpers;
|
|
||||||
|
|
||||||
namespace Greenshot.Test.Drawing.Properties
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Description of SerializationTest.
|
|
||||||
/// </summary>
|
|
||||||
[TestFixture]
|
|
||||||
public class SerializationTest
|
|
||||||
{
|
|
||||||
|
|
||||||
public SerializationTest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestSerializeField() {
|
|
||||||
Field f = new Field(FieldType.ARROWHEADS, GetType());
|
|
||||||
f.myValue = ArrowContainer.ArrowHeadCombination.BOTH;
|
|
||||||
|
|
||||||
Field clone = (Field) Objects.DeepClone(f);
|
|
||||||
Assert.AreEqual(f, clone);
|
|
||||||
Assert.AreEqual(f.Value, clone.Value);
|
|
||||||
Assert.AreEqual(f.Scope, clone.Scope);
|
|
||||||
|
|
||||||
f.Scope = this.GetType().ToString();
|
|
||||||
|
|
||||||
clone = (Field) Objects.DeepClone(f);
|
|
||||||
Assert.AreEqual(f, clone);
|
|
||||||
Assert.AreEqual(f.Value, clone.Value);
|
|
||||||
Assert.AreEqual(f.Scope, clone.Scope);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestSerializeFieldHolder() {
|
|
||||||
AbstractFieldHolder afh = new TestFieldHolder();
|
|
||||||
AbstractFieldHolder clone = (AbstractFieldHolder)Objects.DeepClone(afh);
|
|
||||||
Assert.AreEqual(afh.GetFields(), clone.GetFields());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestSerializeFieldHolderWithChildren() {
|
|
||||||
AbstractFieldHolderWithChildren afh = new TestFieldHolderWithChildren();
|
|
||||||
AbstractFieldHolderWithChildren clone = (AbstractFieldHolderWithChildren)Objects.DeepClone(afh);
|
|
||||||
Assert.AreEqual(afh.GetFields(), clone.GetFields());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestSerializeFilterContainer() {
|
|
||||||
ObfuscateContainer oc = new ObfuscateContainer(new Surface());
|
|
||||||
|
|
||||||
ObfuscateContainer clone = (ObfuscateContainer)Objects.DeepClone(oc);
|
|
||||||
Assert.AreEqual(oc.Children.GetType(), clone.Children.GetType());
|
|
||||||
System.Collections.Generic.List<Field> ocFields = oc.GetFields();
|
|
||||||
System.Collections.Generic.List<Field> cloneFields = clone.GetFields();
|
|
||||||
Assert.AreEqual(ocFields, cloneFields);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
private class TestFieldHolder : AbstractFieldHolder {}
|
|
||||||
[Serializable]
|
|
||||||
private class TestFieldHolderWithChildren : AbstractFieldHolderWithChildren {}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,207 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Greenshot.Configuration;
|
|
||||||
using Greenshot.Drawing;
|
|
||||||
using Greenshot.Forms;
|
|
||||||
using Greenshot.Helpers;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
using NUnit.Framework;
|
|
||||||
|
|
||||||
namespace Greenshot.Test
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class ScaleHelperTest {
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void FreeScaleTest() {
|
|
||||||
RectangleF r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_BOTTOM_RIGHT, new PointF(10,20));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_BOTTOM_RIGHT, new PointF(30,40));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(30, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_BOTTOM_CENTER, new PointF(9999,40));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_BOTTOM_LEFT, new PointF(3,40));
|
|
||||||
Assert.AreEqual(3, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(7, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_MIDDLE_RIGHT, new PointF(48,9999));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(48, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_MIDDLE_RIGHT, new PointF(8,9999));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(8, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_TOP_RIGHT, new PointF(17,-37));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(-37, r.Top);
|
|
||||||
Assert.AreEqual(17, r.Width);
|
|
||||||
Assert.AreEqual(57, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_TOP_CENTER, new PointF(9998,-77));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(-77, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(97, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.Scale(ref r, Gripper.POSITION_TOP_LEFT, new PointF(-23,-54));
|
|
||||||
Assert.AreEqual(-23, r.Left);
|
|
||||||
Assert.AreEqual(-54, r.Top);
|
|
||||||
Assert.AreEqual(33, r.Width);
|
|
||||||
Assert.AreEqual(74, r.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void RationalScaleTest() {
|
|
||||||
RectangleF r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_BOTTOM_RIGHT, new PointF(10,20));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_BOTTOM_RIGHT, new PointF(30,60));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(30, r.Width);
|
|
||||||
Assert.AreEqual(60, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_BOTTOM_RIGHT, new PointF(30,96768));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(30, r.Width);
|
|
||||||
Assert.AreEqual(60, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_BOTTOM_CENTER, new PointF(9999,40));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_BOTTOM_LEFT, new PointF(-90, 9234));
|
|
||||||
Assert.AreEqual(-90, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(100, r.Width);
|
|
||||||
Assert.AreEqual(200, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_MIDDLE_RIGHT, new PointF(48,9999));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(48, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_MIDDLE_RIGHT, new PointF(8,9999));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(8, r.Width);
|
|
||||||
Assert.AreEqual(20, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,20,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_TOP_RIGHT, new PointF(20,829634235));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(20, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(0,0,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_TOP_CENTER, new PointF(9998,-77));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(-77, r.Top);
|
|
||||||
Assert.AreEqual(10, r.Width);
|
|
||||||
Assert.AreEqual(97, r.Height);
|
|
||||||
|
|
||||||
r = new RectangleF(10,20,10,20);
|
|
||||||
ScaleHelper.RationalScale(ref r, Gripper.POSITION_TOP_LEFT, new PointF(0,0));
|
|
||||||
Assert.AreEqual(0, r.Left);
|
|
||||||
Assert.AreEqual(0, r.Top);
|
|
||||||
Assert.AreEqual(20, r.Width);
|
|
||||||
Assert.AreEqual(40, r.Height);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*[Test]
|
|
||||||
public void GetFileNameWithExtensionTest() {
|
|
||||||
SaveImageFileDialog sifd = new SaveImageFileDialog();
|
|
||||||
|
|
||||||
sifd.InitialDirectory = @"C:\some\path";
|
|
||||||
sifd.FileName = "myimage.jpg";
|
|
||||||
sifd.Extension = "jpg";
|
|
||||||
Assert.AreEqual("myimage.jpg",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
sifd.Extension = "gif";
|
|
||||||
Assert.AreEqual("myimage.jpg.gif",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
sifd.FileName = "myimage";
|
|
||||||
Assert.AreEqual("myimage.gif",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void SuggestBasicFileNameTest() {
|
|
||||||
//conf.Output_FileAs_Fullpath = @"c:\path\to\greenshot_testdir\gstest_28.jpg";
|
|
||||||
conf.OutputFilePath = @"c:\path\to\greenshot_testdir\";
|
|
||||||
conf.OutputFileFilenamePattern = "gstest_${NUM}";
|
|
||||||
conf.OutputFileFormat = OutputFormat.png;
|
|
||||||
conf.OutputFileIncrementingNumber = 28;
|
|
||||||
SaveImageFileDialog sifd = new SaveImageFileDialog();
|
|
||||||
|
|
||||||
Assert.AreEqual(sifd.InitialDirectory, @"c:\path\to\greenshot_testdir");
|
|
||||||
Assert.AreEqual(sifd.FileNameWithExtension, "gstest_000028.jpg");
|
|
||||||
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Greenshot.Configuration;
|
|
||||||
using Greenshot.Forms;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
using NUnit.Framework;
|
|
||||||
|
|
||||||
namespace Greenshot.Test
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class SaveImageFileDialogTest {
|
|
||||||
private static CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
|
|
||||||
[Test]
|
|
||||||
public void GetSetExtensionTest() {
|
|
||||||
SaveImageFileDialog sifd = new SaveImageFileDialog();
|
|
||||||
sifd.Extension = "jpg";
|
|
||||||
Assert.AreEqual(sifd.Extension, "jpg");
|
|
||||||
sifd.Extension = "gif";
|
|
||||||
Assert.AreEqual(sifd.Extension, "gif");
|
|
||||||
sifd.Extension = "png";
|
|
||||||
Assert.AreEqual(sifd.Extension, "png");
|
|
||||||
sifd.Extension = "bmp";
|
|
||||||
Assert.AreEqual(sifd.Extension, "bmp");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void GetFileNameWithExtensionTest() {
|
|
||||||
SaveImageFileDialog sifd = new SaveImageFileDialog();
|
|
||||||
|
|
||||||
sifd.InitialDirectory = @"C:\some\path";
|
|
||||||
sifd.FileName = "myimage.jpg";
|
|
||||||
sifd.Extension = "jpg";
|
|
||||||
Assert.AreEqual("myimage.jpg",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
sifd.Extension = "gif";
|
|
||||||
Assert.AreEqual("myimage.jpg.gif",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
sifd.FileName = "myimage";
|
|
||||||
Assert.AreEqual("myimage.gif",sifd.FileNameWithExtension);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void SuggestBasicFileNameTest() {
|
|
||||||
//conf.Output_FileAs_Fullpath = @"c:\path\to\greenshot_testdir\gstest_28.jpg";
|
|
||||||
conf.OutputFilePath = @"c:\path\to\greenshot_testdir\";
|
|
||||||
conf.OutputFileFilenamePattern = "gstest_${NUM}";
|
|
||||||
conf.OutputFileFormat = OutputFormat.png;
|
|
||||||
conf.OutputFileIncrementingNumber = 28;
|
|
||||||
SaveImageFileDialog sifd = new SaveImageFileDialog();
|
|
||||||
|
|
||||||
Assert.AreEqual(sifd.InitialDirectory, @"c:\path\to\greenshot_testdir");
|
|
||||||
Assert.AreEqual(sifd.FileNameWithExtension, "gstest_000028.jpg");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
|
@ -1,79 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
using Greenshot.Plugin;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// This processor shows how the current surface could be modified before it's passed to the editor or another destination
|
|
||||||
/// </summary>
|
|
||||||
public class AnnotateProcessor : AbstractProcessor {
|
|
||||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(AnnotateProcessor));
|
|
||||||
private static PluginExampleConfiguration conf = IniConfig.GetIniSection<PluginExampleConfiguration>();
|
|
||||||
|
|
||||||
private IGreenshotHost host;
|
|
||||||
|
|
||||||
public AnnotateProcessor(IGreenshotHost host) {
|
|
||||||
this.host = host;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Designation {
|
|
||||||
get {
|
|
||||||
return "Annotate";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Description {
|
|
||||||
get {
|
|
||||||
return Designation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool isActive {
|
|
||||||
get {
|
|
||||||
return conf.AnnotationProcessor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) {
|
|
||||||
surface.SelectElement(surface.AddCursorContainer(Cursors.Hand, 100, 100));
|
|
||||||
// Do something with the screenshot
|
|
||||||
string title = captureDetails.Title;
|
|
||||||
if (title != null) {
|
|
||||||
LOG.Debug("Added title to surface: " + title);
|
|
||||||
surface.SelectElement(surface.AddTextContainer(title, HorizontalAlignment.Center, VerticalAlignment.CENTER,
|
|
||||||
FontFamily.GenericSansSerif, 12f, false, false, false, 2, Color.Red, Color.White));
|
|
||||||
}
|
|
||||||
surface.SelectElement(surface.AddTextContainer(Environment.UserName, HorizontalAlignment.Right, VerticalAlignment.TOP,
|
|
||||||
FontFamily.GenericSansSerif, 12f, false, false, false, 2, Color.Red, Color.White));
|
|
||||||
surface.SelectElement(surface.AddTextContainer(Environment.MachineName, HorizontalAlignment.Right, VerticalAlignment.BOTTOM,
|
|
||||||
FontFamily.GenericSansSerif, 12f, false, false, false, 2, Color.Red, Color.White));
|
|
||||||
surface.SelectElement(surface.AddTextContainer(captureDetails.DateTime.ToLongDateString(), HorizontalAlignment.Left, VerticalAlignment.BOTTOM,
|
|
||||||
FontFamily.GenericSansSerif, 12f, false, false, false, 2, Color.Red, Color.White));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using GreenshotPlugin.Controls;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
public class ExampleForm : GreenshotForm{
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
using Greenshot.Plugin;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// This processor shows how the current surface could be modified before it's passed to the editor or another destination
|
|
||||||
/// </summary>
|
|
||||||
public class GreyscaleProcessor : AbstractProcessor {
|
|
||||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(GreyscaleProcessor));
|
|
||||||
private static PluginExampleConfiguration conf = IniConfig.GetIniSection<PluginExampleConfiguration>();
|
|
||||||
private IGreenshotHost host;
|
|
||||||
|
|
||||||
public GreyscaleProcessor(IGreenshotHost host) {
|
|
||||||
this.host = host;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Designation {
|
|
||||||
get {
|
|
||||||
return "Greyscale";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Description {
|
|
||||||
get {
|
|
||||||
return Designation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool isActive {
|
|
||||||
get {
|
|
||||||
return conf.GreyscaleProcessor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) {
|
|
||||||
LOG.DebugFormat("Changing surface to grayscale!");
|
|
||||||
using (BitmapBuffer bbb = new BitmapBuffer(surface.Image as Bitmap, false)) {
|
|
||||||
bbb.Lock();
|
|
||||||
for(int y=0;y<bbb.Height; y++) {
|
|
||||||
for(int x=0;x<bbb.Width; x++) {
|
|
||||||
Color color = bbb.GetColorAt(x, y);
|
|
||||||
int luma = (int)((0.3*color.R) + (0.59*color.G) + (0.11*color.B));
|
|
||||||
color = Color.FromArgb(luma, luma, luma);
|
|
||||||
bbb.SetColorAt(x, y, color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,82 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using System.IO;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
using Greenshot.Plugin;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// An example Plugin so developers can see how they can develop their own plugin
|
|
||||||
/// </summary>
|
|
||||||
public class PluginExample : IGreenshotPlugin {
|
|
||||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PluginExample));
|
|
||||||
private IGreenshotHost host;
|
|
||||||
private PluginAttribute myAttributes;
|
|
||||||
|
|
||||||
public PluginExample() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<IDestination> Destinations() {
|
|
||||||
yield return new SimpleOutputDestination(host);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<IProcessor> Processors() {
|
|
||||||
yield return new AnnotateProcessor(host);
|
|
||||||
yield return new GreyscaleProcessor(host);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Implementation of the IGreenshotPlugin.Initialize
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param>
|
|
||||||
/// <param name="captureHost">Use the ICaptureHost interface to register in the MainContextMenu</param>
|
|
||||||
/// <param name="pluginAttribute">My own attributes</param>
|
|
||||||
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
|
|
||||||
public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) {
|
|
||||||
LOG.Debug("Initialize called of " + myAttributes.Name);
|
|
||||||
|
|
||||||
this.host = pluginHost;
|
|
||||||
this.myAttributes = myAttributes;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Shutdown() {
|
|
||||||
LOG.Debug("Shutdown of " + myAttributes.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Implementation of the IPlugin.Configure
|
|
||||||
/// </summary>
|
|
||||||
public virtual void Configure() {
|
|
||||||
LOG.Debug("Configure called");
|
|
||||||
SettingsForm settingsForm = new SettingsForm();
|
|
||||||
settingsForm.ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\CommonProject.properties" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{6BD38118-B27F-43A1-951C-FB6464D39260}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<RootNamespace>PluginExample</RootNamespace>
|
|
||||||
<AssemblyName>PluginExample</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
|
||||||
<NoStdLib>False</NoStdLib>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<TargetFrameworkProfile />
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="log4net">
|
|
||||||
<HintPath>..\Greenshot\Lib\log4net.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="ExampleForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="GreyscaleProcessor.cs" />
|
|
||||||
<Compile Include="PluginExampleConfiguration.cs" />
|
|
||||||
<Compile Include="SimpleOutputDestination.cs" />
|
|
||||||
<Compile Include="AnnotateProcessor.cs" />
|
|
||||||
<Compile Include="PluginExample.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="SettingsForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SettingsForm.Designer.cs">
|
|
||||||
<DependentUpon>SettingsForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<None Include="Properties\AssemblyInfo.cs.template" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj">
|
|
||||||
<Project>{5B924697-4DCD-4F98-85F1-105CB84B7341}</Project>
|
|
||||||
<Name>GreenshotPlugin</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)"
|
|
||||||
copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp"</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
|
@ -1,40 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// Description of PluginExampleConfiguration.
|
|
||||||
/// </summary>
|
|
||||||
[IniSection("PluginExample", Description="Plugin Example configuration")]
|
|
||||||
public class PluginExampleConfiguration : IniSection {
|
|
||||||
[IniProperty("GreyScaleProcessor", Description="Enable or disable the greyscale processor.", DefaultValue="False")]
|
|
||||||
public bool GreyscaleProcessor;
|
|
||||||
|
|
||||||
[IniProperty("AnnotationProcessor", Description="Enable or disable the annotation processor.", DefaultValue="False")]
|
|
||||||
public bool AnnotationProcessor;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#region Using directives
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("PluginExample")]
|
|
||||||
[assembly: AssemblyDescription("An example plugin")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("Greenshot")]
|
|
||||||
[assembly: AssemblyProduct("Example Plugin")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright 2007-2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// This sets the default COM visibility of types in the assembly to invisible.
|
|
||||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The assembly version has following format :
|
|
||||||
//
|
|
||||||
// Major.Minor.Build.Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can use the default the Revision and
|
|
||||||
// Build Numbers by using the '*' as shown below:
|
|
||||||
[assembly: AssemblyVersion("1.2.0.7")]
|
|
||||||
[assembly: AssemblyInformationalVersion("1.2.0.7-gdb8b2cb")]
|
|
119
PluginExample/SettingsForm.Designer.cs
generated
119
PluginExample/SettingsForm.Designer.cs
generated
|
@ -1,119 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
namespace PluginExample
|
|
||||||
{
|
|
||||||
partial class SettingsForm
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Designer variable used to keep track of non-visual components.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Disposes resources used by the form.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing) {
|
|
||||||
if (components != null) {
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// This method is required for Windows Forms designer support.
|
|
||||||
/// Do not change the method contents inside the source code editor. The Forms designer might
|
|
||||||
/// not be able to load this method if it was changed manually.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
this.checkBox1 = new GreenshotPlugin.Controls.GreenshotCheckBox();
|
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
|
||||||
this.button2 = new System.Windows.Forms.Button();
|
|
||||||
this.checkBox2 = new GreenshotPlugin.Controls.GreenshotCheckBox();
|
|
||||||
this.SuspendLayout();
|
|
||||||
//
|
|
||||||
// checkBox1
|
|
||||||
//
|
|
||||||
this.checkBox1.Location = new System.Drawing.Point(12, 12);
|
|
||||||
this.checkBox1.Name = "checkBox1";
|
|
||||||
this.checkBox1.PropertyName = "AnnotationProcessor";
|
|
||||||
this.checkBox1.SectionName = "PluginExample";
|
|
||||||
this.checkBox1.Size = new System.Drawing.Size(152, 24);
|
|
||||||
this.checkBox1.TabIndex = 0;
|
|
||||||
this.checkBox1.Text = "Annotation processor";
|
|
||||||
this.checkBox1.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// button1
|
|
||||||
//
|
|
||||||
this.button1.Location = new System.Drawing.Point(12, 72);
|
|
||||||
this.button1.Name = "button1";
|
|
||||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.button1.TabIndex = 1;
|
|
||||||
this.button1.Text = "Ok";
|
|
||||||
this.button1.UseVisualStyleBackColor = true;
|
|
||||||
this.button1.Click += new System.EventHandler(this.Button1Click);
|
|
||||||
//
|
|
||||||
// button2
|
|
||||||
//
|
|
||||||
this.button2.Location = new System.Drawing.Point(100, 72);
|
|
||||||
this.button2.Name = "button2";
|
|
||||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.button2.TabIndex = 2;
|
|
||||||
this.button2.Text = "Cancel";
|
|
||||||
this.button2.UseVisualStyleBackColor = true;
|
|
||||||
this.button2.Click += new System.EventHandler(this.Button2Click);
|
|
||||||
//
|
|
||||||
// checkBox2
|
|
||||||
//
|
|
||||||
this.checkBox2.Location = new System.Drawing.Point(12, 42);
|
|
||||||
this.checkBox2.Name = "checkBox2";
|
|
||||||
this.checkBox2.PropertyName = "GreyScaleProcessor";
|
|
||||||
this.checkBox2.SectionName = "PluginExample";
|
|
||||||
this.checkBox2.Size = new System.Drawing.Size(152, 24);
|
|
||||||
this.checkBox2.TabIndex = 3;
|
|
||||||
this.checkBox2.Text = "Greyscale processor";
|
|
||||||
this.checkBox2.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// SettingsForm
|
|
||||||
//
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.ClientSize = new System.Drawing.Size(200, 106);
|
|
||||||
this.Controls.Add(this.checkBox2);
|
|
||||||
this.Controls.Add(this.button2);
|
|
||||||
this.Controls.Add(this.button1);
|
|
||||||
this.Controls.Add(this.checkBox1);
|
|
||||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
|
||||||
this.Name = "SettingsForm";
|
|
||||||
this.Text = "Plugin example settings";
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
private GreenshotPlugin.Controls.GreenshotCheckBox checkBox2;
|
|
||||||
private System.Windows.Forms.Button button2;
|
|
||||||
private System.Windows.Forms.Button button1;
|
|
||||||
private GreenshotPlugin.Controls.GreenshotCheckBox checkBox1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// Description of SettingsForm.
|
|
||||||
/// </summary>
|
|
||||||
public partial class SettingsForm : ExampleForm {
|
|
||||||
private static PluginExampleConfiguration conf = IniConfig.GetIniSection<PluginExampleConfiguration>();
|
|
||||||
|
|
||||||
public SettingsForm() {
|
|
||||||
//
|
|
||||||
// The InitializeComponent() call is required for Windows Forms designer support.
|
|
||||||
//
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Button1Click(object sender, EventArgs e) {
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Button2Click(object sender, EventArgs e) {
|
|
||||||
DialogResult = DialogResult.Cancel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
/*
|
|
||||||
* Greenshot - a free and open source screenshot tool
|
|
||||||
* Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
|
||||||
*
|
|
||||||
* For more information see: http://getgreenshot.org/
|
|
||||||
* The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
|
||||||
*
|
|
||||||
* 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 1 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, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
|
|
||||||
using Greenshot.Plugin;
|
|
||||||
using GreenshotPlugin.Controls;
|
|
||||||
using GreenshotPlugin.Core;
|
|
||||||
using Greenshot.IniFile;
|
|
||||||
|
|
||||||
namespace PluginExample {
|
|
||||||
/// <summary>
|
|
||||||
/// This destination shows a simple save to...
|
|
||||||
/// </summary>
|
|
||||||
public class SimpleOutputDestination : AbstractDestination {
|
|
||||||
private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SimpleOutputDestination));
|
|
||||||
private IGreenshotHost host;
|
|
||||||
|
|
||||||
public SimpleOutputDestination(IGreenshotHost host) {
|
|
||||||
this.host = host;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Designation {
|
|
||||||
get {
|
|
||||||
return "SimpleOutput";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string Description {
|
|
||||||
get {
|
|
||||||
return Designation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
|
|
||||||
ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
|
|
||||||
CoreConfiguration config = IniConfig.GetIniSection<CoreConfiguration>();
|
|
||||||
OutputSettings outputSettings = new OutputSettings();
|
|
||||||
|
|
||||||
string file = FilenameHelper.GetFilename(OutputFormat.png, null);
|
|
||||||
string filePath = Path.Combine(config.OutputFilePath, file);
|
|
||||||
using (FileStream stream = new FileStream(filePath, FileMode.Create)) {
|
|
||||||
using (Image image = surface.GetImageForExport()) {
|
|
||||||
ImageOutput.SaveToStream(image, stream, outputSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exportInformation.Filepath = filePath;
|
|
||||||
exportInformation.ExportMade = true;
|
|
||||||
ProcessExport(exportInformation, surface);
|
|
||||||
return exportInformation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,10 +3,10 @@
|
||||||
# Assumes the installation of Microsoft .NET Framework 4.5
|
# Assumes the installation of Microsoft .NET Framework 4.5
|
||||||
################################################################
|
################################################################
|
||||||
# Greenshot - a free and open source screenshot tool
|
# Greenshot - a free and open source screenshot tool
|
||||||
# Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
# Copyright (C) 2007-2015 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
#
|
#
|
||||||
# For more information see: http://getgreenshot.org/
|
# For more information see: http://getgreenshot.org/
|
||||||
# The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
# The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
# Assumes the installation of Microsoft .NET Framework 4.5
|
# Assumes the installation of Microsoft .NET Framework 4.5
|
||||||
################################################################
|
################################################################
|
||||||
# Greenshot - a free and open source screenshot tool
|
# Greenshot - a free and open source screenshot tool
|
||||||
# Copyright (C) 2007-2014 Thomas Braun, Jens Klingen, Robin Krom
|
# Copyright (C) 2007-2016 Thomas Braun, Jens Klingen, Robin Krom
|
||||||
#
|
#
|
||||||
# For more information see: http://getgreenshot.org/
|
# For more information see: http://getgreenshot.org/
|
||||||
# The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/
|
# The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue