This repository has been archived by the owner on Feb 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snipper overhaul, optimizations Move functions around Rename variables
- Loading branch information
Mike
committed
Jul 21, 2014
1 parent
8e0e71a
commit cd93199
Showing
16 changed files
with
1,975 additions
and
1,779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Specialized; | ||
using System.Drawing; | ||
using System.Net; | ||
using System.Text; | ||
|
||
namespace hyperdesktop2 | ||
{ | ||
class Imgur | ||
{ | ||
public static WebClient web_client = new WebClient(); | ||
|
||
public static Boolean upload(Bitmap bmp) | ||
{ | ||
try | ||
{ | ||
var data = new NameValueCollection(); | ||
|
||
var image = Global_Func.bmp_to_base64(bmp, Global_Func.ext_to_imageformat(Settings.upload_format)); | ||
data.Add("image", image); | ||
|
||
web_client.Headers.Add("Authorization", "Client-ID " + Settings.imgur_client_id); | ||
web_client.UploadValuesAsync( | ||
new Uri("https://api.imgur.com/3/image/"), | ||
"POST", | ||
data | ||
); | ||
|
||
web_client.Dispose(); | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
public static Boolean delete(String delete_hash) | ||
{ | ||
try | ||
{ | ||
var web_client = new WebClient(); | ||
|
||
web_client.Headers.Add("Authorization", "Client-ID " + Settings.imgur_client_id); | ||
web_client.UploadData( | ||
new Uri("https://api.imgur.com/3/image/" + delete_hash), | ||
"DELETE", | ||
new Byte[] { 0x0 } | ||
); | ||
|
||
web_client.Dispose(); | ||
return true; | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Drawing.Drawing2D; | ||
using System.Windows.Forms; | ||
|
||
namespace hyperdesktop2 | ||
{ | ||
class Screen_Bounds | ||
{ | ||
public static Rectangle bounds; | ||
|
||
public static void load() | ||
{ | ||
String[] bounds_arr = Settings.screen_res.Split(','); | ||
bounds = new Rectangle( | ||
Convert.ToInt32(bounds_arr[0]), | ||
Convert.ToInt32(bounds_arr[1]), | ||
Convert.ToInt32(bounds_arr[2]), | ||
Convert.ToInt32(bounds_arr[3]) | ||
); | ||
} | ||
public static String reset() | ||
{ | ||
var screen_bounds_temp = new Rectangle(0, 0, 0, 0); | ||
|
||
foreach (var screen in Screen.AllScreens) | ||
if (screen != Screen.PrimaryScreen) | ||
screen_bounds_temp = Rectangle.Union(screen.Bounds, screen_bounds_temp); | ||
|
||
return String.Format( | ||
"{0},{1},{2},{3}", | ||
screen_bounds_temp.Left, | ||
screen_bounds_temp.Top, | ||
SystemInformation.VirtualScreen.Width, | ||
SystemInformation.VirtualScreen.Height | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.