I am trying to run a Windows app on Mac using Wineskin. The app uses the functions GetDIBits and BitBlt for the purpose of capturing a snapshot of the screen. The problem is that these functions seem to behave a little different with Wineskin than in Windows. For example: HBITMAP hbm; hbm = (HBITMAP) GetCurrentObject(bitmapDC, OBJ_BITMAP); GetDIBits(bitmapDC, hbm, 0, 0, NULL, (LPBITMAPINFO) bitmapInfo, DIB_RGB_COLORS); After I do the above, I get wrong info in bitmapInfo (bitcount 1 instead of 32, width 1 instead of 1366, height 1 instead of 768, compression BI_RGB instead of the BI_BITFIELDS that I get in Windows). Also, when I use BitBlt to copy from screen DC to a bitmap DC, I get a black bitmap when running on Wine. I'm new to Wine (the reason I'm using Wineskin) and after some Googling I came across the notes on DIBEngine. Compiling wine is no small task on a Mac, so before I start down that road, can anyone tell me: will DIBEngine fix this issue?
On Sun, 20 Nov 2011 01:47:02 -0300, Dribble <wineforum-user at winehq.org> wrote:> I am trying to run a Windows app on Mac using Wineskin. The app uses the functions GetDIBits and BitBlt for the purpose of capturing a snapshot of the screen. > > The problem is that these functions seem to behave a little different with Wineskin than in Windows. For example: > > HBITMAP hbm; > hbm = (HBITMAP) GetCurrentObject(bitmapDC, OBJ_BITMAP); > GetDIBits(bitmapDC, hbm, 0, 0, NULL, (LPBITMAPINFO) bitmapInfo, DIB_RGB_COLORS); > > After I do the above, I get wrong info in bitmapInfo (bitcount 1 instead of 32, width 1 instead of 1366, height 1 instead of 768, compression BI_RGB instead of the BI_BITFIELDS that I get in Windows). > > Also, when I use BitBlt to copy from screen DC to a bitmap DC, I get a black bitmap when running on Wine. > > I'm new to Wine (the reason I'm using Wineskin) and after some Googling I came across the notes on DIBEngine. Compiling wine is no small task on a Mac, so before I start down that road, can anyone tell me: will DIBEngine fix this issue? >Ending up with a 1x1 b/w bitmap is a quite normal occurrence even in "real" Windows, if the DC's/bitmaps are not obtained/created/selected/initialized in the right way/sequence. Whether that is the case here is impossible to tell from your example. If you can document a difference in behavior (with a code sample), you should report it as a bug. Roald
Should I be compiling with the DIBEngine patches or are they already compiled in with 1.3.33? Here's the source code of a simpler project that gets the same result (albeit with MFC added -- and yes, I added MFC via WineTricks): http://www.codeproject.com/KB/GDI/barry_s_screen_capture.aspx. Still, a black screen. Before I can say whether it's a bug or not and report it (I'm a rookie here -- I don't want to give false positives), are there any experienced Wine people out there who can say whether or not DIBEngine patches need to be compiled in or if there's some other configuration I should be doing? Wine Version: 1.3.33 Wrapper: WineSkin 2.5.3