Jump to content


Photo

Screencapture For Gamemaker


  • Please log in to reply
47 replies to this topic

#1 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 08 December 2007 - 05:29 PM

Posted Image

Description:
This DLL allows the programmer to take snapshots of the screen. There are three main functions:

License:
Free for non-commercial use. Contact me at rsf1000@gmail.com for a license.

Functions:
CaptureDesktop - Takes a snapshot of the entire screen. (In the next update, I will fix this so it actually captures the desktop window.)
CaptureWindow - This function is able to take a snapshot of the client area of a window! You can also use this as a faster method to saving screenshots of the game.
GetWindowHandle - Gets the handle of a window to be used with CaptureWindow.

Refer to the example game's comments to see how these functions work.

Posted Image | Posted Image
Download Contents:
- ScreenCaptureExample.exe
- ScreenCaptureExample.gmk
- ScreenCapture.dll
- ReadMe.txt

Edited by Frawley, 12 December 2007 - 11:36 PM.

  • 1

#2 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 08 December 2007 - 05:31 PM

Reserved for future screenshots.
  • 0

#3 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 08 December 2007 - 11:55 PM

Sorry to tell you, but I can't really see much of a use for this. However, it's nice to see more people contributing to this section of the GMC.
  • 0

#4 HiroLord

HiroLord

    GMC Member

  • GMC Member
  • 255 posts

Posted 09 December 2007 - 12:15 AM

I tried it... nothing ever happened :S

No file created D:
  • 0

#5 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 09 December 2007 - 01:12 AM

Sorry to tell you, but I can't really see much of a use for this.  However, it's nice to see more people contributing to this section of the GMC.

<{POST_SNAPBACK}>


Have you ever heard of screensavers? Many of them take a snapshot and then edit it, like mysterious in win xp. HiroLord, do you have windows xp, because I think microsoft fu**ed up visual studio 2005 on vista so that DLLs created with it dont work on xp.

Edited by Frawley, 09 December 2007 - 01:14 AM.

  • 0

#6 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 10 December 2007 - 06:59 PM

Yes, I have heard of screensavers, but here is my point:

"CaptureDesktop" - ooohh!!! *Presses PrtScrn button*
"CaptureWindow" - ooohh!!! *Ctrl+Alt+PrtScrn*
"GetWindowHandle" - ooohh!!! *Types window_handle() into GM*
  • 0

#7 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 12 December 2007 - 04:22 AM

Yes, I have heard of screensavers, but here is my point:

"CaptureDesktop" - ooohh!!! *Presses PrtScrn button*
"CaptureWindow" - ooohh!!! *Ctrl+Alt+PrtScrn*
"GetWindowHandle" - ooohh!!! *Types window_handle() into GM*

<{POST_SNAPBACK}>


You are an idiot. Those are not at all how the functions work. First of all, window_handle() only gets the handle of the game window, not other windows. CTRL ALT PRINT SCREEN only takes a snapshot of a maximized window, so good try, you fail.

Edit: Why don't you try contributing something useful. After all, you are a "C++ Coder". After reading a few of your replies, all I see are third party tools that show the same information as task manager or by typing 'winver' into run ("oooh").

Edited by Frawley, 12 December 2007 - 04:38 AM.

  • 0

#8 cdm319

cdm319

    C++ Programmer

  • New Member
  • 885 posts

Posted 12 December 2007 - 05:28 PM

Congratulations on trying to annoy me. But supposedly like you said to me "you fail". And if you read my first post, I offered constructive criticism, and welcomed you to the section of the GMC dedicated to DLL creations. However, instead of accepting my welcome, you've more like spat in my face.

Also, I don't know what version of windows you are using, but Ctrl+Alt+PrtScrn take a snapshot of only the active window, not the maximised one.

Oh, and you can slag my System Information DLL all you want, because if you read other peoples' replies, you will see that it has one thing your DLL doesn't:
Positive Feedback

Thank you, and goodnight.

Chris Matthews


Edit: Oh, and explain to me the "third party" thing about my DLLs?

Edited by cdm319, 12 December 2007 - 05:33 PM.

  • 0

#9 HiroLord

HiroLord

    GMC Member

  • GMC Member
  • 255 posts

Posted 12 December 2007 - 09:14 PM

Yeah, i use Windows XP

I really wish I could use this :skull:
  • 0

#10 retrogamer

retrogamer

    Button Masher

  • New Member
  • 468 posts

Posted 12 December 2007 - 10:43 PM

There are easy GML scripts to do most of those actions, HiroLord. It is pretty simple, you don't need a DLL for most of these.

Also, from the manuel:

Note that DLLs cannot be used in secure mode.


That might help.

Edited by retrogamer, 12 December 2007 - 10:44 PM.

  • 0

#11 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 12 December 2007 - 11:29 PM

Hiro, I fixed the bug! All versions of windows can now use this, sorry it took a while. And to clarify, you do need a dll for all of these functions. Gamemaker can only take a snapshot of the game window, not other windows.

Edited by Frawley, 13 December 2007 - 12:24 AM.

  • 0

#12 Newly Discovered

Newly Discovered

    Harmonious Genius

  • GMC Member
  • 2475 posts
  • Version:GM8

Posted 13 December 2007 - 05:43 AM

arg, you're both wrong.
ctrl + alt+ prnt scrn doesn't do either of those things.
alt + prnt screen captures the active window/menu/taskbar.
using control in this sequence is completely useless.
  • 0

#13 Frawley

Frawley

    GMC Member

  • New Member
  • 53 posts

Posted 13 December 2007 - 01:10 PM

arg, you're both wrong.
ctrl + alt+ prnt scrn doesn't do either of those things.
alt + prnt screen captures the active window/menu/taskbar.
using control in this sequence is completely useless.

<{POST_SNAPBACK}>


Regardless, my dll doesn't use key combinations to capture the screen. It uses gid+. One more thing, if you try the example, run notepad.exe first because that is the window that I set it to capture. Or you can edit the example.

Edited by Frawley, 13 December 2007 - 01:13 PM.

  • 0

#14 Bram Buurlage

Bram Buurlage

    GMC Member

  • New Member
  • 51 posts

Posted 15 December 2007 - 11:02 AM

___________________________________________
ERROR in
action number 1
of Create Event
for object object0:

Error defining an external function.

this is in your example...
  • 0

#15 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 16 December 2007 - 11:37 AM

Yup, this happens to me too :)
  • 0

#16 HiroLord

HiroLord

    GMC Member

  • GMC Member
  • 255 posts

Posted 16 December 2007 - 04:31 PM

*Ehem*

CaptureDesktop(handle, "test.bmp");
Returns this;
___________________________________________
ERROR in
action number 1
of Create Event
for object object0:

In script CaptureDesktop:
Error in code at line 13:
return external_call(CaptureDesktopId, argument0);

at position 23: Unknown variable CaptureDesktopId



CaptureWindow(handle, "test.bmp");
Doesn't create a file.

:)
  • 0

#17 necrotic

necrotic

    GMC Member

  • New Member
  • 238 posts

Posted 17 December 2007 - 01:46 AM

Thank you for making this! I have had use for this in the past, and I'm glad someone -finally- got around to making it :lol:
  • 0

#18 dk81584

dk81584

    Program Maker

  • New Member
  • 171 posts
  • Version:GM8

Posted 28 March 2008 - 02:19 AM

*Ehem*

CaptureDesktop(handle, "test.bmp");
Returns this;
___________________________________________
ERROR in
action number 1
of Create Event
for object object0:

In script CaptureDesktop:
Error in code at line 13:
return external_call(CaptureDesktopId, argument0);

at position 23: Unknown variable CaptureDesktopId



CaptureWindow(handle, "test.bmp");
Doesn't create a file.

^_^


Yeah, go into the CaptureWindow and CaptureScreen scripts and change "CaptureWindowId" to "CaptureScreenId", it should work
for you then, oh, and by the way, nice ddl, minus the little script glitch you forgot to fix, but you should take care of that, cuz this is
pretty usefull for screensavers and other stuff, again, nice job!
  • 0

#19 LehdaRi

LehdaRi

    GMC Member

  • New Member
  • 28 posts

Posted 31 March 2008 - 01:19 PM

This seems to work on notepad only... I tried Paint, Firefox, IE and even CMD but nothing happened. Just with the notepad. :S
  • 0

#20 fire_soul453

fire_soul453

    aarons video games

  • GMC Member
  • 542 posts

Posted 05 April 2008 - 01:27 AM

Great dll. I love the CaptureDesktop. I plan I using this soon. I have a few uses for it.

Edited by fire_soul453, 05 April 2008 - 02:33 PM.

  • 0

#21 Midnightz

Midnightz

    GMC Member

  • New Member
  • 154 posts

Posted 22 July 2008 - 12:33 AM

It is very useful :lol:
  • 0

#22 hiro-niro

hiro-niro

    GMC Member

  • New Member
  • 707 posts

Posted 26 July 2008 - 12:10 AM

Why would I use this instead of Pressing (Alt)PrtSc and then Opening MSPaint and Pressing C+V and then pressing C+S?
  • 0

#23 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 30 July 2008 - 10:06 PM

Because this does those things all together.
  • 0

#24 Kale_Ryuu

Kale_Ryuu

    GMC Member

  • GMC Member
  • 544 posts

Posted 08 August 2008 - 06:46 AM

so I have tried this and failed...

what do i have to do exactly to take the shot of the enitre screen... just like pressing printscreen... all i get is black image... =\
  • 0

#25 Kax

Kax

    GMC Member

  • New Member
  • 6 posts

Posted 18 August 2008 - 03:05 PM

Yes, I have heard of screensavers, but here is my point:

"CaptureDesktop" - ooohh!!! *Presses PrtScrn button*
"CaptureWindow" - ooohh!!! *Ctrl+Alt+PrtScrn*
"GetWindowHandle" - ooohh!!! *Types window_handle() into GM*

That is quite it... well it's good to have a dll that handles those well, but the license sux. You think ppl will pay or something for this?
  • 0

#26 LaLaLa

LaLaLa

    GMC Member

  • New Member
  • 511 posts
  • Version:GM8

Posted 29 March 2009 - 05:43 PM

Yes, I have heard of screensavers, but here is my point:

"CaptureDesktop" - ooohh!!! *Presses PrtScrn button*
"CaptureWindow" - ooohh!!! *Ctrl+Alt+PrtScrn*
"GetWindowHandle" - ooohh!!! *Types window_handle() into GM*

That is quite it... well it's good to have a dll that handles those well, but the license sux. You think ppl will pay or something for this?

How do you people not realize that the point of this DLL is to do these things through Game Maker? Yes, you can pres <Alt> + <Print Screen> (not with <Control>) to capture the window in focus, but Game Maker only deals with text on the clipboard, not images or anything else, so even if you generated these key presses, you would have no way of saving the image on the clipboard to a file, or gaining any access to it.

You have to use this DLL to get the entire screen / active window and save it to a file. Using the functions in GML only get the room as an image; test it and you will find it doesn't get the window border, nor the entire desktop and task bar etc.

So, please think about the applications of this DLL before you start making completely stupid coments and making yourself look like an idiot to any intelligent individual on these forums.

Edited by LaLaLa, 24 June 2010 - 04:53 AM.

  • 0

#27 006

006

    GMC Member

  • GMC Member
  • 178 posts

Posted 10 April 2009 - 06:09 PM

Is there a way to make this .Dll capture a minimized window??
  • 0

#28 Staticgames

Staticgames

    GMC Member

  • New Member
  • 115 posts

Posted 16 August 2009 - 06:54 PM

No effence, but i find no use of this,,, i mean, GM7 has a built in F9 button that takes a screenshot, my laptop has a PrintScreen button that takes a screenshot, and i tested what that first guy u argued with said about teh Ctrl+Alt+Prntscreen, and he was right, it did only take a picture of the window, so sorry, i find no use,,,
On the plus size, im glad u contributed to GM : D

EDIT: actually, now i kinda find this less useful,,, because u need to go and open gm to do something, what if *And this happend to me*
Ur computer was being stupid, and every 20 secounds, a error message poped up and disapeared after a split secound, how am i gonna go to gm, open this game,,, and what, take a screenshot of them game to look at the errormessage?, or just Prntscreen?

EDIT2: @Lalala:
NO EFFENCE AT ALL!, but i just read ur post, with my friend, and we both thought when we read it "Wow, she just made herself look like an idiot infront of us,,,"
Standing up for what in our minds is the truth doesent make us look like an idiot, well, it depends who the person talking is, because to me, the people saying this is super useful i find look stupid, but to you, its the people who say its not useful at all, so thats ur OPINION, next time, please dont generalise and say "any intelligenet GML coder. ", cause im intelligent, and i honestly find no use in this. *Just stating a OPINION, not a fact*

Edited by Staticgames, 17 August 2009 - 07:38 PM.

  • -1

#29 Mister_M

Mister_M

    GMC Member

  • New Member
  • 499 posts

Posted 07 October 2009 - 09:51 AM

The link is down T~T
  • 0

#30 Yambam

Yambam

    GMC Member

  • GMC Member
  • 632 posts
  • Version:GM8

Posted 20 October 2009 - 02:34 PM

The link is down T~T

savefile is almost done so be patient
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users