gdi

Screen capture of specific window c++

大兔子大兔子 提交于 2021-01-01 08:57:13
问题 I want to take a screenshot of some specific window (e.g calculator). Here is the code I have written according to this discussion: // Get the window handle of calculator application. HWND hWnd = ::FindWindow(0, _T("Calculator")); RECT r; GetWindowRect(hWnd, &r); int x[2]; int y[2]; x[0] = r.top; x[1] = r.bottom; y[0] = r.left; y[1] = r.right; HDC hScreen = GetWindowDC(hWnd); HDC hDC = CreateCompatibleDC(hScreen); HBITMAP hBitmap = CreateCompatibleBitmap(hScreen, y[1] - y[0], x[1] - x[0]);

Load HICON from the buffer (*.ico file)

谁说胖子不能爱 提交于 2020-08-19 10:19:22
问题 I'm just wondering, if there an API in Windows for loading the HICON from the byte array (buffer)? Let's say that I downloaded an *.ico file and I have the content of this file in some buffer. I want to be able to create the HICON from that buffer. It is possible to load HICON from the *.ico which is placed on the hard drive, so I guess that there should be an equally simple way to do it from the memory buffer? So far I found only 2 solutions but none of them is suitable for me. The first one

Load HICON from the buffer (*.ico file)

纵然是瞬间 提交于 2020-08-19 10:17:46
问题 I'm just wondering, if there an API in Windows for loading the HICON from the byte array (buffer)? Let's say that I downloaded an *.ico file and I have the content of this file in some buffer. I want to be able to create the HICON from that buffer. It is possible to load HICON from the *.ico which is placed on the hard drive, so I guess that there should be an equally simple way to do it from the memory buffer? So far I found only 2 solutions but none of them is suitable for me. The first one

Load HICON from the buffer (*.ico file)

微笑、不失礼 提交于 2020-08-19 10:17:05
问题 I'm just wondering, if there an API in Windows for loading the HICON from the byte array (buffer)? Let's say that I downloaded an *.ico file and I have the content of this file in some buffer. I want to be able to create the HICON from that buffer. It is possible to load HICON from the *.ico which is placed on the hard drive, so I guess that there should be an equally simple way to do it from the memory buffer? So far I found only 2 solutions but none of them is suitable for me. The first one

Cannot save TIF file using GDI+

百般思念 提交于 2020-08-09 09:31:12
问题 I have a vb.net app that selects and loads a JPG file LoadedImage = Image.FromFile(InputImageName) then attempts to save the file as a TIF using GDI+ LoadedImage.Save(TIF_ImageName, ImageFormat.Tiff) There are no syntax errors, but the save fails with System.InvalidCastException was unhandled Message=Conversion from string "System.Runtime.InteropServices.E" to type 'Integer' is not valid. I have tried using a bitmap instead of image, no joy The image is large (9000x11000 pixels) Is this an

Cannot save TIF file using GDI+

孤街浪徒 提交于 2020-08-09 09:31:04
问题 I have a vb.net app that selects and loads a JPG file LoadedImage = Image.FromFile(InputImageName) then attempts to save the file as a TIF using GDI+ LoadedImage.Save(TIF_ImageName, ImageFormat.Tiff) There are no syntax errors, but the save fails with System.InvalidCastException was unhandled Message=Conversion from string "System.Runtime.InteropServices.E" to type 'Integer' is not valid. I have tried using a bitmap instead of image, no joy The image is large (9000x11000 pixels) Is this an

GDI+ performance tricks [closed]

为君一笑 提交于 2020-06-24 04:02:18
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Does anyone know of any reliable (and, hopefully, extensive) books/websites that discuss GDI+ performance (beyond the obvious)? For