It is currently Mon Dec 09, 2019 6:52 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Mon Mar 15, 2004 10:47 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 6:03 pm
Posts: 3000
Location: Lincoln, UK
Quote:
Also, to be able to publish high quality pictures, I don't want to scale up an original screen resolution screen grab....

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.

_________________
--Kale

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 15, 2004 11:18 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Jan 24, 2004 6:56 pm
Posts: 768
Kale,

for that very reason I stated that I don't want to scale up. I'd like to see a solution that gives a much higher resolution bitmap, perhaps by re-rendering the selected window/control somewhere else in memory and then grab the image from that much larger presentation.

_________________
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 16, 2004 12:19 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 6:03 pm
Posts: 3000
Location: Lincoln, UK
Quote:
for that very reason I stated that I don't want to scale up. I'd like to see a solution that gives a much higher resolution bitmap

So its pointless taking a screen grap then. You will have to draw whatever you need.

_________________
--Kale

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 16, 2004 9:39 am 
Offline
Addict
Addict
User avatar

Joined: Sun Mar 07, 2004 8:47 am
Posts: 1857
Location: Argentina
How do you highlight the roll overed region (with the mouse, so you can capture that active region only) and it must be highlighted to better see.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 05, 2004 12:52 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Jan 24, 2004 6:56 pm
Posts: 768
Einander,

thank you for pointing out this redundancy: a control is a window too... :)

_________________
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 30, 2004 5:11 am 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 30, 2003 11:19 pm
Posts: 1808
Location: Emerald Cove, Unformed
cecilcheah wrote:
Hi there

Code:
keybd_event_(#VK_SNAPSHOT,0,0,0) ; Snapshot of entire desktop.


looks like it does not work for win 95/98, it needs to be:

Code:
keybd_event_(#VK_SNAPSHOT,1,0,0) ; Snapshot of entire desktop.


Anyone knows what about Win NT, Win 2000 or Win XP?

Cecil


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 perfectly :D

Anyways ...

The code provided here is missing the DEVMODE structure ... ... .. so they dont work.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 30, 2004 4:26 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 6:03 pm
Posts: 3000
Location: Lincoln, UK
Quote:
The code provided here is missing the DEVMODE structure ... ... .. so they dont work.

It should do, its defined in PB itself. press alt-s in the pb ide to see the predefined structures.

_________________
--Kale

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 01, 2005 3:44 am 
Offline
Addict
Addict
User avatar

Joined: Thu Oct 30, 2003 11:19 pm
Posts: 1808
Location: Emerald Cove, Unformed
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).

Code:
CaptureScreen(WindowX(),WindowY(),WindowWidth() + 5,WindowHeight() + 25)


Notice the + 5 and + 25 in the code.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Jan 01, 2005 9:57 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jul 29, 2003 5:47 pm
Posts: 296
Location: FRANCE
To take a screenshot of all of the screen I use this line :

Code:
 ScreenCaptureAddress = CaptureScreen(0, 0, GetSystemMetrics_(#SM_CXSCREEN), GetSystemMetrics_(#SM_CYSCREEN))


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 ;)

_________________
- Registered PB user -

Using PB 4.00


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 14, 2005 8:05 am 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 2004
Location: USA
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 14, 2005 2:51 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4580
Location: Spa, relaxing and thinking, and learning...
Baker,
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 14, 2005 6:59 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 6:03 pm
Posts: 3000
Location: Lincoln, UK
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.

I would put all needed repeating code into a procedure then use:
Code:
SetTimer_(WindowID(), #Timer, millisecs, @Procedure())

this then repeats the procedure at the millisec interval you specify. :)

_________________
--Kale

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Feb 14, 2005 7:53 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4580
Location: Spa, relaxing and thinking, and learning...
Code:
ScreenCaptureAddress = CaptureScreen(192, 112, 256, 256)


Kale,
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Screen Capture
PostPosted: Thu Apr 25, 2019 11:19 am 
Offline
User
User

Joined: Tue Feb 14, 2006 2:00 pm
Posts: 63
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:

Code:
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


Uncomment the clipboard part and try again. No memory usage is rising anymore. Why?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye