mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 18:57:28 -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
|
@ -673,7 +673,7 @@ namespace Greenshot.Drawing {
|
|||
e.Effect=DragDropEffects.None;
|
||||
} else {
|
||||
List<string> filenames = GetFilenames(e);
|
||||
if ((filenames != null && filenames.Count > 0) || e.Data.GetDataPresent(DataFormats.Bitmap, true) || e.Data.GetDataPresent(DataFormats.EnhancedMetafile, true)) {
|
||||
if ((filenames != null && filenames.Count > 0) || e.Data.GetDataPresent("DragImageBits") || e.Data.GetDataPresent(DataFormats.Bitmap, true) || e.Data.GetDataPresent(DataFormats.EnhancedMetafile, true)) {
|
||||
e.Effect=DragDropEffects.Copy;
|
||||
} else {
|
||||
e.Effect=DragDropEffects.None;
|
||||
|
@ -684,6 +684,18 @@ namespace Greenshot.Drawing {
|
|||
private void OnDragDrop(object sender, DragEventArgs e) {
|
||||
List<string> filenames = GetFilenames(e);
|
||||
Point mouse = this.PointToClient(new Point(e.X, e.Y));
|
||||
if (e.Data.GetDataPresent("Text")) {
|
||||
string possibleUrl = (string)e.Data.GetData("Text");
|
||||
if (possibleUrl != null && possibleUrl.StartsWith("http")) {
|
||||
using (Bitmap image = NetworkHelper.DownloadImage(possibleUrl)) {
|
||||
if (image != null) {
|
||||
AddBitmapContainer(image, mouse.X, mouse.Y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((filenames != null && filenames.Count > 0)) {
|
||||
foreach (string filename in filenames) {
|
||||
if (filename != null && filename.Trim().Length > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue