Slasheree Posted December 26, 2012 Author Share Posted December 26, 2012 With this tutorial I'll show you the way I found to take screenshots of your game, this source with some modifications will surely work with any other version of Eclipse.First let's start by going to where the engine handles when a key goes up (HandleKeyUp in CS:DE)Add below If Not chatOn Then```If keyCode = vbKeySnapshot ThenTakeScreenShotEnd If```Then in the form where the graphics are processed (frmMain in CS:DE) add a picturebox of any size (I made small) and name it Picture1Then in the Form_Load() add this anywhere in it:```Picture1.height = 600Picture1.Width = 800Picture1.top = 0Picture1.left = 0```Then we will add the function to actually take the screenshot, go to modDirectX8 and add in the bottom```Public Function TakeScreenShot()Dim filename As StringDim i As LongDim imX As LongDim imY As Long'align form, because it gets the screenshot wrong in some positions...With frmMain.top = (Screen.height - .height) / 2.left = (Screen.Width - .Width) / 2End With'check for a "free" nameDoi = i + 1filename = App.path & "\screenshot_" & Format(i, "0000") & ".bmp"Loop Until Len(dir(filename)) = 0'take and save uncropped screenshotkeybd_event vbKeySnapshot, 0, 0, 0 'will pretend you pressed the Print Screen buttonDoEventsSavePicture Clipboard.GetData(vbCFBitmap), filenameDoEvents'load and edit the screenshot (crop)imX = (((Screen.Width + frmMain.left) - Screen.Width) / 15) + 3imY = (((Screen.height + frmMain.top) - Screen.height) / 15) + 25frmMain.Picture1.PaintPicture LoadPicture(filename), 0, 0, 800, 600, imX, imY, 800, 600'save screenshot croppedKill filenameSavePicture frmMain.Picture1.Image, filenameDoEvents'send message so they know it workedAddText "Screenshot saved [" & Right$(filename, 16) & "]", BrightBlueEnd Function```And I guess we are done ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)I hope this works for you, if it doesn't maybe it's because I edited the engine too much, but here is some important information1- in imY = (((Screen.height + frmMain.top) - Screen.height) / 15) + 25 I divided by 15 because of a conversion needed for the twips and added 25 because it's the thickness of the part of the form that has the name and minimize maximize and close buttons, this might mess up the screenshot for people with a dpi different from 100% (96dpi I think)2- I still haven't fully tested this with other monitor resolutions, gotta free up some space in my desktop to change and test, or maybe you could give me some feedback on what happens to you ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)[EDIT] Forgot to say that to take a screenshot you use the Print Screen button ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
Vus Posted December 26, 2012 Share Posted December 26, 2012 Nice work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now