Impossible! Images can only be scaled down 'without' image quality loss, not scaled up to higher resolutions. If an image is scaled up a 'blurring' occurs.Also, to be able to publish high quality pictures, I don't want to scale up an original screen resolution screen grab....
Screen Capture
-
- Enthusiast
- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
-
- Enthusiast
- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
Had to drag this up as I was looking for working screenshot code ... the above does not work because the snapshot thingie doesnt work some times For example, at the time of this post the print screen function works for all windows that do not have a dx screen on them. So I have to find some alternate means of taking a screenshot and PB code that doesnt require the scrnprnt function works perfectlycecilcheah wrote:Hi there
looks like it does not work for win 95/98, it needs to be:Code: Select all
keybd_event_(#VK_SNAPSHOT,0,0,0) ; Snapshot of entire desktop.
Anyone knows what about Win NT, Win 2000 or Win XP?Code: Select all
keybd_event_(#VK_SNAPSHOT,1,0,0) ; Snapshot of entire desktop.
Cecil
Anyways ...
The code provided here is missing the DEVMODE structure ... ... .. so they dont work.
Thanks for the info Just a tip for the rest If your taking a screenshot of just a window of yours, the following is required when taking the shot, or else the screenshot will cut off the window on the left and right. erk!
Notice, I am using winXP SP 2 on regular mode (no eye candy junk/theme).
Notice the + 5 and + 25 in the code.
Notice, I am using winXP SP 2 on regular mode (no eye candy junk/theme).
Code: Select all
CaptureScreen(WindowX(),WindowY(),WindowWidth() + 5,WindowHeight() + 25)
To take a screenshot of all of the screen I use this line :
and it seems to take the whole desktop no matter the resolution (the easiest way I found to do so).
Thx to Kale for the code
Code: Select all
ScreenCaptureAddress = CaptureScreen(0, 0, GetSystemMetrics_(#SM_CXSCREEN), GetSystemMetrics_(#SM_CYSCREEN))
Thx to Kale for the code
- Registered PB user -
Using PB 4.00
Using PB 4.00
Trying to figure out how to capture the screen every few seconds. I know there's Delay() and ElapsedMilliseconds() but I'm not sure if these are the correct commands to use for this? At least I haven't had any success with them (probably my lack of knowledge with setting a timer in PB). Any help would be great, thanks.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
- Psychophanta
- Addict
- Posts: 4975
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Baker,
use Delay() function into a loop. It should work.
Kale,
A bitmap handle is a memory address?
use Delay() function into a loop. It should work.
Kale,
A bitmap handle is a memory address?
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
I would put all needed repeating code into a procedure then use:J. Baker wrote:Trying to figure out how to capture the screen every few seconds. I know there's Delay() and ElapsedMilliseconds() but I'm not sure if these are the correct commands to use for this? At least I haven't had any success with them (probably my lack of knowledge with setting a timer in PB). Any help would be great, thanks.
Code: Select all
SetTimer_(WindowID(), #Timer, millisecs, @Procedure())
- Psychophanta
- Addict
- Posts: 4975
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Code: Select all
ScreenCaptureAddress = CaptureScreen(192, 112, 256, 256)
here you assign as "Address" to a "bitmap handle".
If you know what the hell is exactly internally a handle (named by microsoft), please tell us, else forget this.
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: Screen Capture
This screengrabber is nice and works good. But only when you using it for capturing into clipboard. If you use the version from Kale, then there can be memory problem. Basically if you will remove that clipboard part then your memory is not released and still filling up. Not good when you want to repeatedly capture images.
I don't know why clipboard part can fix that.
Try this and look at your rising memory usage:
Uncomment the clipboard part and try again. No memory usage is rising anymore. Why?
I don't know why clipboard part can fix that.
Try this and look at your rising memory usage:
Code: Select all
Procedure CaptureScreen(Left, Top, Width, Height)
dm.DEVMODE ;structure for CreateDC()
srcDC = CreateDC_("DISPLAY", "", "", dm)
trgDC = CreateCompatibleDC_(srcDC)
BMPHandle = CreateCompatibleBitmap_(srcDC, Width, Height)
SelectObject_( trgDC, BMPHandle)
BitBlt_( trgDC, 0, 0, Width, Height, srcDC, Left, Top, #SRCCOPY)
;OpenClipboard_(#Null)
;EmptyClipboard_()
;SetClipboardData_(2, BMPHandle)
;CloseClipboard_()
DeleteDC_( trgDC)
ReleaseDC_( BMPHandle, srcDC)
ProcedureReturn
EndProcedure
Repeat
CaptureScreen( 0, 0, 800, 600)
Delay(1)
ForEver
- doctorized
- Addict
- Posts: 854
- Joined: Fri Mar 27, 2009 9:41 am
- Location: Athens, Greece
Re: Screen Capture
In my case, "My computer" window is captured with some extra pixels. Why? See the image below. Win 10 Pro x64 fully updated
https://ibb.co/qdPggpj
https://ibb.co/qdPggpj