Jump to content


Photo

Screencapture For Gamemaker


  • Please log in to reply
46 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

  • New Member
  • 2467 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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users