Changed code for the Clipboard and changed a lot of "Bitmap" code to work on images, this might give problems but if these are solved we have better support for MetaFiles. This made it possible to remove the MetafileContainer, which is replaced by the ImageContainer (which is the BitmapContainer modified). The clipboard code now knows more ways to load images from the clipboard!

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2398 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-12-20 12:33:17 +00:00
parent b7a604d93b
commit f627ce5dd0
15 changed files with 301 additions and 382 deletions

View file

@ -86,16 +86,15 @@ namespace GreenshotPlugin.Core {
/// </summary>
/// <param name="baseUri"></param>
/// <returns>Bitmap</returns>
public static Bitmap DownloadImage(string url) {
public static Image 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);
return ImageHelper.Clone(image);
}
}
} catch (Exception e) {
LOG.Error("Problem downloading the image from: " + url, e);
}