cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.79k stars 2.92k forks source link

Feature Request - Implement WPF Image Drag #1330

Open bjarteskogoy opened 8 years ago

bjarteskogoy commented 8 years ago

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.

amaitland commented 8 years ago

Anyone working on this?

Not that I'm aware of.

bjarteskogoy commented 8 years ago

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.

amaitland commented 8 years ago

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 commented 8 years ago

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

amaitland commented 8 years ago

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

cztomczak commented 7 years ago

Implementing drag image representation is upstream CEF Issue #1715.

amaitland commented 7 years ago

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

timaiv commented 3 years ago

@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

amaitland commented 3 years ago

@timaiv Not sure what you mean exactly.

timaiv commented 3 years ago

@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.