-
October 20th, 2011, 06:01 PM
#1
how to capture a part of the screen from second monitor
hello all,
i made an app to save part of my screen to a jpeg... it works great on single monitor... but if i pass a rect thats not within the main monitor the image will be black... anyone know they easy way to get part of the screen on any monitor... thx...
•SlimGradey•
-
October 20th, 2011, 08:26 PM
#2
Re: how to capture a part of the screen from second monitor
So how do you get the second monitor screen ?
Pumpobee is prolounced as mumbolee
-
October 21st, 2011, 12:54 PM
#3
Re: how to capture a part of the screen from second monitor
this the code i use to take snap shot of my screen and crop it to the rect i want.. then save as jpeg...
works fine on single monitor... how can i change this to work on dual monitors...
Code:
HDC WinDC;
HDC CopyDC;
HBITMAP hBitmap;
ULONG bWidth,bHeight;
WinDC = ::GetDC(NULL);
CopyDC = CreateCompatibleDC(WinDC);
bWidth = GetDeviceCaps(WinDC, HORZRES);
bHeight = GetDeviceCaps(WinDC, VERTRES);
hBitmap = CreateCompatibleBitmap(WinDC,bWidth,bHeight);
SelectObject(CopyDC,hBitmap);
BitBlt(CopyDC,0,0,bWidth,bHeight,WinDC,0,0,SRCCOPY);
::ReleaseDC(NULL,WinDC);
DeleteDC(CopyDC);
HDC hSrc = CreateCompatibleDC(NULL);
SelectObject(hSrc,hBitmap);
HDC hNew = CreateCompatibleDC(hSrc);
HBITMAP hBmp = CreateCompatibleBitmap(hSrc,width,height);
HBITMAP hOld = (HBITMAP)SelectObject(hNew,hBmp);
BitBlt(hNew,0,0,width,height,hSrc,left,top, SRCCOPY);
SelectObject(hNew,hOld);
//code to save jpeg here....
DeleteDC(hSrc);
DeleteDC(hNew);
DeleteObject(hOld);
DeleteObject(hBmp);
DeleteObject(hBitmap);
•SlimGradey•
-
October 30th, 2011, 01:33 PM
#4
Re: how to capture a part of the screen from second monitor
i still need help with this...
trying find way to get bitmap of the second monitor...
and make it work in the code above...
thx...
•SlimGradey•
-
January 20th, 2016, 02:53 PM
#5
Re: how to capture a part of the screen from second monitor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|