mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Fixed a case with Drag & Drop of images where the transparency is gone. Also fixed the editor "Center" patch, this was only working when width & height were smaller.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2283 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
41a63f5847
commit
a075a81daf
3 changed files with 41 additions and 3 deletions
|
@ -80,6 +80,27 @@ namespace GreenshotPlugin.Core {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Download the url to Bitmap
|
||||
/// </summary>
|
||||
/// <param name="baseUri"></param>
|
||||
/// <returns>Bitmap</returns>
|
||||
public static Bitmap DownloadImage(string url) {
|
||||
try {
|
||||
HttpWebRequest request = (HttpWebRequest)NetworkHelper.CreateWebRequest(url);
|
||||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||
if (request.HaveResponse) {
|
||||
using (Image image = Image.FromStream(response.GetResponseStream())) {
|
||||
return new Bitmap(image);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.Error("Problem downloading the image from: " + url, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to create a web request, eventually with proxy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue