mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -07:00
Removed more dead code
This commit is contained in:
parent
601236833b
commit
2bbaa4a9a7
38 changed files with 66 additions and 943 deletions
|
@ -564,15 +564,7 @@ EndSelection:<<<<<<<4
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper for Clipboard.GetText created for Bug #3432313
|
||||
/// </summary>
|
||||
/// <returns>string if there is text on the clipboard</returns>
|
||||
public static string GetText() {
|
||||
return GetText(GetDataObject());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Get Text from the DataObject
|
||||
/// </summary>
|
||||
/// <returns>string if there is text on the clipboard</returns>
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
using GreenshotPlugin.Core.Enums;
|
||||
using GreenshotPlugin.UnmanagedHelpers;
|
||||
using log4net;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
|
@ -36,8 +35,6 @@ namespace GreenshotPlugin.Core
|
|||
/// </summary>
|
||||
public static class DpiHelper
|
||||
{
|
||||
private static readonly ILog Log = LogManager.GetLogger(typeof(DpiHelper));
|
||||
|
||||
/// <summary>
|
||||
/// This is the default DPI for the screen
|
||||
/// </summary>
|
||||
|
|
|
@ -28,29 +28,6 @@ namespace GreenshotPlugin.Core.Enums
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum HResult
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
S_OK = 0,
|
||||
S_FALSE = 1,
|
||||
E_FAIL = unchecked((int)0x80004005),
|
||||
E_INVALIDARG = unchecked((int)0x80070057),
|
||||
E_NOTIMPL = unchecked((int)0x80004001),
|
||||
E_POINTER = unchecked((int)0x80004003),
|
||||
E_PENDING = unchecked((int)0x8000000A),
|
||||
E_NOINTERFACE = unchecked((int)0x80004002),
|
||||
E_ABORT = unchecked((int)0x80004004),
|
||||
E_ACCESSDENIED = unchecked((int)0x80070006),
|
||||
E_HANDLE = unchecked((int)0x80070006),
|
||||
E_UNEXPECTED = unchecked((int)0x8000FFFF),
|
||||
E_FILENOTFOUND = unchecked((int)0x80070002),
|
||||
E_PATHNOTFOUND = unchecked((int)0x80070003),
|
||||
E_INVALID_DATA = unchecked((int)0x8007000D),
|
||||
E_OUTOFMEMORY = unchecked((int)0x8007000E),
|
||||
E_INSUFFICIENT_BUFFER = unchecked((int)0x8007007A),
|
||||
WSAECONNABORTED = unchecked((int)0x80072745),
|
||||
WSAECONNRESET = unchecked((int)0x80072746),
|
||||
ERROR_TOO_MANY_CMDS = unchecked((int)0x80070038),
|
||||
ERROR_NOT_SUPPORTED = unchecked((int)0x80070032),
|
||||
TYPE_E_ELEMENTNOTFOUND = unchecked((int)0x8002802B)
|
||||
#pragma warning restore 1591
|
||||
}
|
||||
}
|
||||
|
|
|
@ -467,17 +467,7 @@ namespace GreenshotPlugin.Core {
|
|||
return returnIcon;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the number of icon in the file
|
||||
/// </summary>
|
||||
/// <param name="location">Location of the EXE or DLL</param>
|
||||
/// <returns></returns>
|
||||
public static int CountAssociatedIcons(string location)
|
||||
{
|
||||
return Shell32.ExtractIconEx(location, -1, out _, out _, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Apply the effect to the bitmap
|
||||
/// </summary>
|
||||
/// <param name="sourceImage">Bitmap</param>
|
||||
|
@ -1063,17 +1053,7 @@ namespace GreenshotPlugin.Core {
|
|||
ApplyImageAttributes(source, sourceRect, dest, destRect, imageAttributes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply image attributes to the image
|
||||
/// </summary>
|
||||
/// <param name="source">Image to apply matrix to</param>
|
||||
/// <param name="imageAttributes">ImageAttributes to apply</param>
|
||||
public static void ApplyColorMatrix(Bitmap source, ImageAttributes imageAttributes)
|
||||
{
|
||||
ApplyImageAttributes(source, Rectangle.Empty, source, Rectangle.Empty, imageAttributes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Apply a color matrix by copying from the source to the destination
|
||||
/// </summary>
|
||||
/// <param name="source">Image to copy from</param>
|
||||
|
@ -1242,17 +1222,7 @@ namespace GreenshotPlugin.Core {
|
|||
return clone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the supplied Bitmap has a PixelFormat we support
|
||||
/// </summary>
|
||||
/// <param name="image">bitmap to check</param>
|
||||
/// <returns>bool if we support it</returns>
|
||||
public static bool SupportsPixelFormat(Image image)
|
||||
{
|
||||
return SupportsPixelFormat(image.PixelFormat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Checks if we support the pixel format
|
||||
/// </summary>
|
||||
/// <param name="pixelformat">PixelFormat to check</param>
|
||||
|
@ -1462,31 +1432,7 @@ namespace GreenshotPlugin.Core {
|
|||
return newImage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a scaled version of the sourceBitmap
|
||||
/// </summary>
|
||||
/// <param name="sourceBitmap"></param>
|
||||
/// <param name="percent">1-99 to make smaller, use 101 and more to make the picture bigger</param>
|
||||
/// <returns></returns>
|
||||
public static Bitmap ScaleByPercent(Bitmap sourceBitmap, int percent)
|
||||
{
|
||||
float nPercent = (float)percent / 100;
|
||||
|
||||
int sourceWidth = sourceBitmap.Width;
|
||||
int sourceHeight = sourceBitmap.Height;
|
||||
int destWidth = (int)(sourceWidth * nPercent);
|
||||
int destHeight = (int)(sourceHeight * nPercent);
|
||||
|
||||
Bitmap scaledBitmap = CreateEmpty(destWidth, destHeight, sourceBitmap.PixelFormat, Color.Empty, sourceBitmap.HorizontalResolution, sourceBitmap.VerticalResolution);
|
||||
using (Graphics graphics = Graphics.FromImage(scaledBitmap))
|
||||
{
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.DrawImage(sourceBitmap, new Rectangle(0, 0, destWidth, destHeight), new Rectangle(0, 0, sourceWidth, sourceHeight), GraphicsUnit.Pixel);
|
||||
}
|
||||
return scaledBitmap;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Resize canvas with pixel to the left, right, top and bottom
|
||||
/// </summary>
|
||||
/// <param name="sourceImage"></param>
|
||||
|
|
|
@ -50,8 +50,6 @@ namespace GreenshotPlugin.Core {
|
|||
public enum OAuth2AuthorizeMode {
|
||||
Unknown, // Will give an exception, caller needs to specify another value
|
||||
LocalServer, // Will specify a redirect URL to http://localhost:port/authorize, while having a HttpListener
|
||||
MonitorTitle, // Not implemented yet: Will monitor for title changes
|
||||
Pin, // Not implemented yet: Will ask the user to enter the shown PIN
|
||||
EmbeddedBrowser, // Will open into an embedded _browser (OAuthLoginForm), and catch the redirect
|
||||
OutOfBoundAuto
|
||||
}
|
||||
|
|
|
@ -358,16 +358,6 @@ namespace GreenshotPlugin.Core
|
|||
return _childWindows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve children with a certain title or classname
|
||||
/// </summary>
|
||||
/// <param name="titlePattern">The regexp to look for in the title</param>
|
||||
/// <param name="classnamePattern">The regexp to look for in the classname</param>
|
||||
/// <returns>List WindowDetails with all the found windows, or an empty list</returns>
|
||||
public IEnumerable<WindowDetails> FindChildren(string titlePattern, string classnamePattern) {
|
||||
return FindWindow(Children, titlePattern, classnamePattern);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the window's handle
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue