impossible to have screenshot from a second monitor in dual view. Is there a clue where and what can i modify in source code to ba able to screenshot everywhere?
thaks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is a fully functional code. Only thing to know is that if one screen is smaller than the other(s) onclick image near to the bottom will have a black part, but to me this is not really a big problem .
here is two patches
you might clean up a little the code, but this work like this, hope you will be able to integrate this waiting a PIL release that never comes with dual screen support.
Yes sorry i often reverse the two files when i create a patch but the patch command is slever ;) if you have any problem patching i 'll make new ones ;)
Thanks to you !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-01-04
I know I sound silly here, but I was wondering how I should go about applying this patch. I downloaded Patch for windows, but I just can't seem to get it working. I'm not sure if I just messed up the formatting of the file, or if I'm not typing the command correctly or what.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Finally i took the time to double check my patch, here are the two files, the patch are very similar but you were right i pasted two time the same file, sorry for that :
---onclickimagecapture.py.old2009-11-1712:51:34.000000000-0500+++onclickimagecapture.py2010-06-0315:53:22.000000000-0400@@-36,6+36,8@@ifos.name=='nt':importwin32api,win32con,win32processimportImageGrab+importwin32gui,win32ui+hwnd=win32gui.GetDesktopWindow()elifos.name=='posix':fromXlibimportX,XK,display,errorfromXlib.extimportrecord@@-121,7+123,31@@exc_info=True)ifos.name=='nt':-image_data=ImageGrab.grab((cropbox.topleft.x,cropbox.topleft.y,cropbox.bottomright.x,cropbox.bottomright.y))+#image_data = ImageGrab.grab((cropbox.topleft.x, cropbox.topleft.y, cropbox.bottomright.x, cropbox.bottomright.y))+SM_XVIRTUALSCREEN=76+SM_YVIRTUALSCREEN=77+SM_CXVIRTUALSCREEN=78+SM_CYVIRTUALSCREEN=79+w=vscreenwidth=win32api.GetSystemMetrics(SM_CXVIRTUALSCREEN)+h=vscreenheigth=win32api.GetSystemMetrics(SM_CYVIRTUALSCREEN)+l=vscreenx=win32api.GetSystemMetrics(SM_XVIRTUALSCREEN)+t=vscreeny=win32api.GetSystemMetrics(SM_YVIRTUALSCREEN)+r=l+w+b=t+h+hwndDC=win32gui.GetWindowDC(hwnd)+mfcDC=win32ui.CreateDCFromHandle(hwndDC)+saveDC=mfcDC.CreateCompatibleDC()+saveBitMap=win32ui.CreateBitmap()+saveBitMap.CreateCompatibleBitmap(mfcDC,w,h)+saveDC.SelectObject(saveBitMap)+saveDC.BitBlt((0,0),(w,h),mfcDC,(l,t),win32con.SRCCOPY)+bmpinfo=saveBitMap.GetInfo()+#print bmpinfo+#print savefilename+bmpstr=saveBitMap.GetBitmapBits(True)+# image_data = Image.frombuffer('RGB', (bmpinfo['bmWidth'], bmpinfo['bmHeight']), bmpstr, 'raw', 'BGRX', 0, 1)+image_data=Image.frombuffer('RGB',(bmpinfo['bmWidth'],bmpinfo['bmHeight']),bmpstr,'raw','BGRX',0,1)+image_data=image_data.crop((cropbox.topleft.x,cropbox.topleft.y,cropbox.bottomright.x,cropbox.bottomright.y))returnimage_datadefget_screen_size(self):@@-133,8+159,22@@returnPoint(self.rootwin.get_geometry().width,self.rootwin.get_geometry().height)ifos.name=='nt':-returnPoint(win32api.GetSystemMetrics(0),-win32api.GetSystemMetrics(1))+#jpp+SM_XVIRTUALSCREEN=76+SM_YVIRTUALSCREEN=77+SM_CXVIRTUALSCREEN=78+SM_CYVIRTUALSCREEN=79+w=vscreenwidth=win32api.GetSystemMetrics(SM_CXVIRTUALSCREEN)+h=vscreenheigth=win32api.GetSystemMetrics(SM_CYVIRTUALSCREEN)+l=vscreenx=win32api.GetSystemMetrics(SM_XVIRTUALSCREEN)+t=vscreeny=win32api.GetSystemMetrics(SM_YVIRTUALSCREEN)+r=l+w+b=t+h+# return Point(win32api.GetSystemMetrics(0),+# win32api.GetSystemMetrics(1))+returnPoint(r,+b)+defget_username(self):'''Try a few different environment vars to get the username.'''---timedscreenshot.py.old2009-11-1712:51:34.000000000-0500+++timedscreenshot.py2010-06-0315:17:56.000000000-0400@@-34,7+34,9@@ifos.name=='nt':importwin32api-importImageGrab+importImage,ImageGrab+importwin32gui,win32ui,win32con,win32api+hwnd=win32gui.GetDesktopWindow()elifos.name=='posix':importgtkelse:@@-151,7+153,32@@save_options_dict)ifos.name=='nt':-image_data=ImageGrab.grab((cropbox.topleft.x,cropbox.topleft.y,cropbox.bottomright.x,cropbox.bottomright.y))+#image_data = ImageGrab.grab((cropbox.topleft.x, cropbox.topleft.y, cropbox.bottomright.x, cropbox.bottomright.y))+#ajout JPP+SM_XVIRTUALSCREEN=76+SM_YVIRTUALSCREEN=77+SM_CXVIRTUALSCREEN=78+SM_CYVIRTUALSCREEN=79+w=vscreenwidth=win32api.GetSystemMetrics(SM_CXVIRTUALSCREEN)+h=vscreenheigth=win32api.GetSystemMetrics(SM_CYVIRTUALSCREEN)+l=vscreenx=win32api.GetSystemMetrics(SM_XVIRTUALSCREEN)+t=vscreeny=win32api.GetSystemMetrics(SM_YVIRTUALSCREEN)+r=l+w+b=t+h+hwndDC=win32gui.GetWindowDC(hwnd)+mfcDC=win32ui.CreateDCFromHandle(hwndDC)+saveDC=mfcDC.CreateCompatibleDC()+saveBitMap=win32ui.CreateBitmap()+saveBitMap.CreateCompatibleBitmap(mfcDC,w,h)+saveDC.SelectObject(saveBitMap)+saveDC.BitBlt((0,0),(w,h),mfcDC,(l,t),win32con.SRCCOPY)+bmpinfo=saveBitMap.GetInfo()+#print bmpinfo+#print savefilename+bmpstr=saveBitMap.GetBitmapBits(True)+image_data=Image.frombuffer('RGB',(bmpinfo['bmWidth'],bmpinfo['bmHeight']),bmpstr,'raw','BGRX',0,1)+# fin ajout JPP+#image_data = saveBitMapimage_data.save(savefilename,quality=self.subsettings['General']['Screenshot Image Quality'])
Hello,
impossible to have screenshot from a second monitor in dual view. Is there a clue where and what can i modify in source code to ba able to screenshot everywhere?
thaks
Hi,
I am assuming you're running windows, since multi-screen setups work fine on linux…
See this forum thread for possibly-helpful hints:
https://sourceforge.net/projects/pykeylogger/forums/forum/493190/topic/3478561
and let me know if any of that actually works. (as i note in that thread, i don't have a dual-screen windows setup to try this on)…
Yes it is a windows system !
thanks !
i've finally found a workaround without PIL for the capture googling. I will post the modification after the week end.
Here is a fully functional code. Only thing to know is that if one screen is smaller than the other(s) onclick image near to the bottom will have a black part, but to me this is not really a big problem .
here is two patches
you might clean up a little the code, but this work like this, hope you will be able to integrate this waiting a PIL release that never comes with dual screen support.
Hi
Thanks for the patches! I'll look into it when i have a bit of time.
A few notes right off the bat, though:
first, it seems that the two patches are identical…? did you maybe mean to include two distinct ones? :)
second, it seems that old and new are reversed? but i suppose i can deal with that…
Thanks!
Hello,
yes the patch about the same for the two fles.
Yes sorry i often reverse the two files when i create a patch but the patch command is slever ;) if you have any problem patching i 'll make new ones ;)
Thanks to you !
Hi,
Just to double-check something - have you tested imagegrab from the latest PIL, version 1.1.7, and it still doesn't work?
Hello i have test only with the last version available when i first open this thread . which is : PIL-1.1.7.win32-py2.6
and does not work
ah ok, thanks for the info :)
I know I sound silly here, but I was wondering how I should go about applying this patch. I downloaded Patch for windows, but I just can't seem to get it working. I'm not sure if I just messed up the formatting of the file, or if I'm not typing the command correctly or what.
Thanks!
Finally i took the time to double check my patch, here are the two files, the patch are very similar but you were right i pasted two time the same file, sorry for that :
to answer to ca office to apply a patch on a source code :
under linux : http://jungels.net/articles/diff-patch-ten-minutes.html
under windows if you have no linux available : http://docs.moodle.org/dev/How_to_apply_a_patch
a search engine might allow you to find alternatives