FEATURE-838: Added support for dragging an image from google image search results directly into the editor.

This commit is contained in:
Robin 2015-04-15 13:59:36 +02:00
parent ea8c27449f
commit 5d8ad4d021
2 changed files with 53 additions and 7 deletions

View file

@ -148,5 +148,19 @@ namespace GreenshotPlugin.Core {
return returnValue;
}
/// <summary>
/// Read "streamextensions" :)
/// </summary>
/// <param name="input">Stream</param>
/// <param name="output">Stream</param>
public static void CopyTo(this Stream input, Stream output) {
byte[] buffer = new byte[16 * 1024]; // Fairly arbitrary size
int bytesRead;
while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0) {
output.Write(buffer, 0, bytesRead);
}
}
}
}