Page 1 of 6 123 ... LastLast
Results 1 to 10 of 53

Thread: [C#] How to screenshot in MOHAA?

  1. #1
    Client Beta Testers Appelpitje's Avatar
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    571

    Default [C#] How to screenshot in MOHAA?

    Is there a way with C# to take screenshot when MOHAA is running and save it somewhere?

    I've searched on google but i can't get it working..

    Could i use C++ libraries to do this?

  2. #2

    Default

    Must be something as that's what MOHAAC does but cant help with the code soz

  3. #3

    Default

    you can force the player to take a screenshot from is screen with admin pro with stufftext but i dont know if is that you whant :S

  4. #4
    Client Beta Testers Appelpitje's Avatar
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    571

    Default

    No lol, im making an external program that needs to take a screenshot.

  5. #5

  6. #6
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,180

    Default

    Unfortunately, I don't know c#, I imagine the syntax won't be too far off from C\C++, but I wrote a few apps similar to this.

    http://www.x-null.net/forums/showthr...nd-save-as-jpg

    Few things to consider...

    Are your intentions for this to be server or clientside?


    I don't think you can force serverside screenshots... I mean let me rephrase this question... You can force it, but the actualy screenshot code would have to be written clientside...


    So if you're looking for a fail-proof method in creating a screenshot capture in game, here is what you should consider..


    Since this will be clientside, how will you battle someone that can potentially debug your application, and detect when it's triggered. And when it's triggered (assuming you are trying to take a SS of someone wallhacking), they would be able to disable their cheat, take a clean SS and turn the cheat back on.


    You would need to come up with a soultion to detect when\if a client is trying to tamper with your function or bypass it. Similarly like we detect if someone has "hacked" stufftext.


    The link I provided you with, is an optimized SS application, that takes a bitmap image and compresses it using lossless quality PNG. In other words, a normal BMP can be well over 1mb, however my application is able to compress it to a few kb without distorting the resolution. I found this to be the most effective way. And honestly I find it to be better than MOHAA's current Screenshot function because TGA's are difficult to view on the fly unless you open it in an app like Photoshop.


    Anyway, hope this helps. If you're only interested in taking a picture of a specific Window (for example MOHAA) Change this line


    Code:
    HWND DesktopHwnd = GetDesktopWindow();
    to
    Code:
    HWND DesktopHwnd = FindWindow("Medal of Honor Allied Assault",NULL);

    You might want to double check that, but I think that's correct.

  7. #7
    Client Beta Testers Appelpitje's Avatar
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    571

    Default

    Quote Originally Posted by skimkiller View Post
    Thats just for capturing your screen, if u'd try that on a game it'd give u a black screen.
    So it should be taking a screenshot in a OpenGl window or something like that. :P

    Quote Originally Posted by James View Post
    Unfortunately, I don't know c#, I imagine the syntax won't be too far off from C\C++, but I wrote a few apps similar to this.

    http://www.x-null.net/forums/showthr...nd-save-as-jpg

    Few things to consider...

    Are your intentions for this to be server or clientside?


    I don't think you can force serverside screenshots... I mean let me rephrase this question... You can force it, but the actualy screenshot code would have to be written clientside...


    So if you're looking for a fail-proof method in creating a screenshot capture in game, here is what you should consider..


    Since this will be clientside, how will you battle someone that can potentially debug your application, and detect when it's triggered. And when it's triggered (assuming you are trying to take a SS of someone wallhacking), they would be able to disable their cheat, take a clean SS and turn the cheat back on.


    You would need to come up with a soultion to detect when\if a client is trying to tamper with your function or bypass it. Similarly like we detect if someone has "hacked" stufftext.


    The link I provided you with, is an optimized SS application, that takes a bitmap image and compresses it using lossless quality PNG. In other words, a normal BMP can be well over 1mb, however my application is able to compress it to a few kb without distorting the resolution. I found this to be the most effective way. And honestly I find it to be better than MOHAA's current Screenshot function because TGA's are difficult to view on the fly unless you open it in an app like Photoshop.


    Anyway, hope this helps. If you're only interested in taking a picture of a specific Window (for example MOHAA) Change this line


    Code:
    HWND DesktopHwnd = GetDesktopWindow();
    to
    Code:
    HWND DesktopHwnd = FindWindow("Medal of Honor Allied Assault",NULL);

    You might want to double check that, but I think that's correct.
    Thanks James will try that!
    Edit: I think this also wouldnt work for MOHAA(OpenGl)?
    Last edited by Appelpitje; September 15th, 2014 at 01:03 PM.

  8. #8
    Administrator James's Avatar
    Join Date
    May 2010
    Location
    on the intraweb
    Posts
    3,180

    Default

    I don't see why it would only return black? This uses Windows and GDI+ API's, so there's no opengl hooks. Usually OpenGL hooks is what causes problems through GlBegin\GlEnable... This should be effected at all.
    Have you actually tested this? I'm at work right now, so I can't test it, but I don't see why it wouldn't work. The way the code is currently done, it takes a Screenshot of your desktop... Or whatever is in the foreground window. It should work.

  9. #9
    Client Beta Testers Appelpitje's Avatar
    Join Date
    Jan 2012
    Location
    Belgium
    Posts
    571

    Default

    No i was asuming it would take a black screen like most code will do.
    I first have to know how to use C++.. lol

  10. #10
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default

    options:
    1. send the cmd screenshot.
    2. hook mohaa
    3. hook the display buffer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •