WPF - StartDragging populate DataObject with Image#2687
WPF - StartDragging populate DataObject with Image#2687remye06 wants to merge 3 commits intocefsharp:masterfrom
Conversation
…h WPF Drag events DataObject.
|
✅ Build CefSharp 72.0.0-CI2991 completed (commit c31b43d838 by @remye06) |
amaitland
left a comment
There was a problem hiding this comment.
Please include a list of steps used when testing this feature.
| bitmap.Freeze(); | ||
| dataObject.SetImage(bitmap); | ||
| } | ||
| else |
There was a problem hiding this comment.
This should be removed if you've added support for image.
| IImage dragImage = dragData.Image; | ||
| int width, height; | ||
| byte[] pixels = dragImage.GetAsBitmap(1f, ColorType.Rgba8888, AlphaType.PreMultiplied, out width, out height); | ||
| int stride = ((width * 32 + 31) & ~31) / 8; |
There was a problem hiding this comment.
Looks like your using PixelFormats.Pbgra32 below, so it should be the correct format. Use
(PixelFormats.Pbgra32.BitsPerPixel / 8) * width to calculate stride
| { | ||
| IImage dragImage = dragData.Image; | ||
| int width, height; | ||
| byte[] pixels = dragImage.GetAsBitmap(1f, ColorType.Rgba8888, AlphaType.PreMultiplied, out width, out height); |
There was a problem hiding this comment.
Should the scale factor be dynamic based on the display? I would have though so.
|
@remye06 Any update on this? |
|
I've been unable to work on this lastly, due to my schedule, but should be in the upcoming days. |
|
Great 👍 If you can include details on how you've tested this, on what |
|
✅ Build CefSharp 73.1.12.0-CI3047 completed (commit 9c2c3b2fa9 by @amaitland) |
|
If you'd like to see this merged then if you could provided an update in the next 2-3 weeks that would be great, thanks. |
|
Sure, I don't really need it anymore but still want to contribute, so that the effort I put into it so far is not lost and can help someone someday. |
|
If you are able to provide a I can fix the code at some point once I know exactly what it does. |
|
I'm going to address your inquiries starting from tomorrow, as I got myself a little break. I feel very sorry for this delay. |
For instance, this image is necessary to give feedback (content displayed alongside cursor while dragging).