-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPF - StartDragging populate DataObject with Image #2687
base: master
Are you sure you want to change the base?
Conversation
…h WPF Drag events DataObject.
✅ Build CefSharp 72.0.0-CI2991 completed (commit c31b43d838 by @remye06) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include a list of steps used when testing this feature.
bitmap.Freeze(); | ||
dataObject.SetImage(bitmap); | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).