-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Suggestion: Add Direct2D counterparts for GetPixel, SetPixel and Graphics.FromImage #61
Comments
Okay, so I've created a fork of this project and tried to get at least a bitmap of the graphic. I seem to be pretty close now, as it actually gets a bitmap of the correct size, but the contents are all black. Context.cpp:
D2DGraphics.cs:
I'm leaving this here if someone wants to finish it. |
Thanks @MWstudios! I'm also working on a task like this. I will let you know if there is any progress. |
Hi @jingwood |
Bumping an old thread, but if any contributor out there is reading this, there is a way: When we're at it, it's probably more effective to add |
public static Color GetPixelColor(this IComObject? srcBitmap1, IComObject? dc, int x, int y)
|
I need to pick a color from a bitmap, but the GetPixel function only exists in the default Bitmap class. Also graphics from image would allow drawing on top of an existing bitmap and not creating a blank one, which Device.CreateBitmapGraphics is doing.
Edit: You can make an empty graphic and draw the bitmap on it, but I meant that you can't directly edit the existing bitmap, just paste it onto the graphic, and there's no way to get the result back.
The text was updated successfully, but these errors were encountered: