Improved the support for dragging and dropping images from a website, now also parsing HTML img src information, to be able to download that image. For this we need the HtmlAgilityPack.dll (#294)

Removed a lot of dead code, and remove the old OCR code as we don't even know if it still works.
This commit is contained in:
Robin Krom 2021-03-21 22:34:17 +01:00 committed by GitHub
commit 26fe579d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
151 changed files with 1138 additions and 8174 deletions

View file

@ -20,7 +20,6 @@
*/
using System;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using GreenshotPlugin.Core;
@ -30,23 +29,8 @@ namespace GreenshotPlugin.Controls {
/// </summary>
public sealed partial class BackgroundForm : Form {
private volatile bool _shouldClose;
private void BackgroundShowDialog() {
ShowDialog();
}
public static BackgroundForm ShowAndWait(string title, string text) {
BackgroundForm backgroundForm = new BackgroundForm(title, text);
// Show form in background thread
Thread backgroundTask = new Thread (backgroundForm.BackgroundShowDialog);
backgroundForm.Name = "Background form";
backgroundTask.IsBackground = true;
backgroundTask.SetApartmentState(ApartmentState.STA);
backgroundTask.Start();
return backgroundForm;
}
public BackgroundForm(string title, string text){
public BackgroundForm(string title, string text){
//
// The InitializeComponent() call is required for Windows Forms designer support.
//

View file

@ -426,11 +426,7 @@ namespace GreenshotPlugin.Controls {
_hotkeyHwnd = hWnd;
}
public static int RegisterHotKey(string hotkey, HotKeyHandler handler) {
return RegisterHotKey(HotkeyModifiersFromString(hotkey), HotkeyFromString(hotkey),handler);
}
/// <summary>
/// <summary>
/// Register a hotkey
/// </summary>
/// <param name="modifierKeyCode">The modifier, e.g.: Modifiers.CTRL, Modifiers.NONE or Modifiers.ALT</param>
@ -477,21 +473,7 @@ namespace GreenshotPlugin.Controls {
KeyHandlers.Clear();
}
public static void UnregisterHotkey(int hotkey) {
bool removeHotkey = false;
foreach(int availableHotkey in KeyHandlers.Keys) {
if (availableHotkey == hotkey) {
UnregisterHotKey(_hotkeyHwnd, hotkey);
removeHotkey = true;
}
}
if (removeHotkey) {
// Remove key handler
KeyHandlers.Remove(hotkey);
}
}
/// <summary>
/// <summary>
/// Handle WndProc messages for the hotkey
/// </summary>
/// <param name="m"></param>