CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

Feature Request - Implement WPF Image Drag

Open bjarteskogoy opened this issue 8 years ago • 10 comments

We're depending on CKEditor for text editing. Image dragging is no longer working due to the partial implementation of StartDragging in https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/ChromiumWebBrowser.cs#L263.

Anyone working on this? If not I'll try to make it happen.

bjarteskogoy avatar Oct 12 '15 14:10 bjarteskogoy

Anyone working on this?

Not that I'm aware of.

amaitland avatar Oct 12 '15 21:10 amaitland

Is there a wrapper class doing something similar I can look at? Not sure I now what exactly it means to create a wrapper, https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Core/Internals/CefDragDataWrapper.h#L170.

bjarteskogoy avatar Oct 12 '15 21:10 bjarteskogoy

Interface the client can implement to provide a custom stream writer. The methods of this class may be called on any thread.

Quick look at the API and it may be easier to implement CefWriteHandler

http://magpcss.org/ceforum/apidocs3/projects/%28default%29/CefStreamWriter.html#CreateForHandler%28CefRefPtr%3CCefWriteHandler%3E%29 http://magpcss.org/ceforum/apidocs3/projects/%28default%29/CefWriteHandler.html

It will likely be similar to the old StreamAdapter class that's no longer used. Instead of Read, you'd obviously implement Write related functions. https://github.com/cefsharp/CefSharp/blob/cefsharp/43/CefSharp.Core/Internals/StreamAdapter.h

amaitland avatar Oct 12 '15 21:10 amaitland

I'd also check cefclient to see if there is any relevant examples of this feature.

amaitland avatar Oct 12 '15 21:10 amaitland

https://bitbucket.org/chromiumembedded/cef/src/f7d9457c203e6cff86f0c8edd02d068d83459c7c/tests/cefclient/browser/osr_dragdrop_win.cc?at=master&fileviewer=file-view-default#osr_dragdrop_win.cc-252

https://bitbucket.org/chromiumembedded/cef/src/f7d9457c203e6cff86f0c8edd02d068d83459c7c/tests/cefclient/browser/bytes_write_handler.h?at=master&fileviewer=file-view-default

amaitland avatar Oct 12 '15 21:10 amaitland

Implementing drag image representation is upstream CEF Issue #1715.

cztomczak avatar Nov 26 '16 07:11 cztomczak

CEF has added support in commit https://bitbucket.org/chromiumembedded/cef/commits/1f2e2bdc84b7732bd4f466e075412d764d6d51b8

amaitland avatar May 15 '17 12:05 amaitland

@amaitland I implemented drag image preview (output, like from cefsharp to chrome, input not implemented by cef). It is very complicated and takes a lot of code (3rd party), actually need we this now?


image

timaiv avatar Nov 10 '20 20:11 timaiv

@timaiv Not sure what you mean exactly.

amaitland avatar Nov 11 '20 00:11 amaitland

@timaiv Not sure what you mean exactly.

After my changes, near cursor while dragging is appearing image (rendered by OS) preview of selected html content, like in browsers, u can see it in previous image, i highlighted that.

timaiv avatar Nov 11 '20 12:11 timaiv