Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

remye06
Copy link

@remye06 remye06 commented Mar 13, 2019

For instance, this image is necessary to give feedback (content displayed alongside cursor while dragging).

@AppVeyorBot
Copy link

Copy link
Member

@amaitland amaitland left a 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
Copy link
Member

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;
Copy link
Member

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

https://github.com/cefsharp/CefSharp/blob/cefsharp/71/CefSharp.Wpf/Rendering/InteropBitmapRenderHandler.cs#L31

{
IImage dragImage = dragData.Image;
int width, height;
byte[] pixels = dragImage.GetAsBitmap(1f, ColorType.Rgba8888, AlphaType.PreMultiplied, out width, out height);
Copy link
Member

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.

@amaitland amaitland added the wpf label Mar 14, 2019
@amaitland amaitland added this to the 73.0.0 milestone Mar 14, 2019
@amaitland amaitland changed the title Store potential CEF's drag image into Drag events DataObject. WPF - StartDragging populate DataObject with Image Mar 20, 2019
@amaitland
Copy link
Member

@remye06 Any update on this?

@remye06
Copy link
Author

remye06 commented Apr 2, 2019

I've been unable to work on this lastly, due to my schedule, but should be in the upcoming days.

@amaitland
Copy link
Member

Great 👍 If you can include details on how you've tested this, on what OS.

@AppVeyorBot
Copy link

@amaitland
Copy link
Member

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.

@remye06
Copy link
Author

remye06 commented May 25, 2019

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.

@amaitland
Copy link
Member

If you are able to provide a Url that you used for testing and a list of steps that you used for testing with.

I can fix the code at some point once I know exactly what it does.

@amaitland amaitland removed this from the 75.0.0 milestone Jun 19, 2019
@remye06
Copy link
Author

remye06 commented Jul 1, 2019

I'm going to address your inquiries starting from tomorrow, as I got myself a little break. I feel very sorry for this delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants