-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Import HBitmap directly? #57
Comments
I have added a new API method
By the way, if you capture the entire screen, you may consider to use this method, which doesn't need to use hbitmap. I am not sure if it brings better performance. |
Thanks! Christian |
And.. Thanks for the link. I wanted to capture a region of the screen. Trying to capture a window but having issues with application which are hardware rendered so right now the best effort is to capture a part of a screen but I really would like to capture a window and the content of it rather than the screen. |
Glad to hear that works. |
Hi!
I am capture the screen and trying to present the captured image in a D2DImage. Everything works fine, but the question is if it can be more efficient.
Right now I am getting a hBitmap from the Cope screen function, which I convert into a GDI which I send to D2D image which converts it back to an hbitmap?
Do you think there could be an option to feed the hbitmap directly?
Best
Christian
Dim desktophWnd As IntPtr
Dim desktopDc As IntPtr
Dim memoryDc As IntPtr
Dim bitmap As IntPtr
Dim oldBitmap As IntPtr
Dim success As Boolean
'Dim result As Bitmap
desktophWnd = GetDesktopWindow()
desktopDc = GetWindowDC(desktophWnd)
memoryDc = CreateCompatibleDC(desktopDc)
bitmap = CreateCompatibleBitmap(desktopDc, region.Width, region.Height)
oldBitmap = SelectObject(memoryDc, bitmap)
The text was updated successfully, but these errors were encountered: