• Home
  • Index
  • Search
  • Download
  • Server Rules
  • House Roleplay Laws
  • Player Utilities
  • Player Help
  • Forum Utilities
  • Returning Player?
  • Toggle Sidebar
Interactive Nav-Map
Tutorials
New Wiki
ID reference
Restart reference
Players Online
Player Activity
Faction Activity
Player Base Status
Discord Help Channel
DarkStat
Server public configs
POB Administration
Missing Powerplant
Stuck in Connecticut
Account Banned
Lost Ship/Account
POB Restoration
Disconnected
Member List
Forum Stats
Show Team
View New Posts
View Today's Posts
Calendar
Help
Archive Mode




Hi there Guest,  
Existing user?   Sign in    Create account
Login
Username:
Password: Lost Password?
 
  Discovery Gaming Community Welcome Help & Support Tutorials & Tools Community Technical Guides
1 2 Next »
Print Screen button not taking Screenshots

Server Time (24h)

Players Online

Active Events - Scoreboard

Latest activity

Pages (2): 1 2 Next »
Print Screen button not taking Screenshots
Offline ronillon
05-25-2021, 04:10 AM, (This post was last modified: 05-25-2021, 04:13 AM by ronillon.)
#1
Copper Storage Depot
Posts: 563
Threads: 19
Joined: Oct 2012

As you might know, it is possible to take screenshots in Freelancer without the use of external programs.

If everything works fine, you press "Print Screen" key and a BMP file with screenshot is created in c:\Users\%username%\Pictures\FreelancerShots\
This should work pretty much everywhere in Freelancer, from the MAIN MENU to the Bar on Planet Curacao.

Recently this stopped working for me.
And it appears that it does not work for others and has not worked for others in the past: Screenshots for Freelancer

Of course it is possible to take screenshots using external tools like Steam, Xfire, Fraps, programs associated with your GPU and many others.
But I decided to figure out why the native screenshot functionality was no longer working.

It turned out, that the culprit was Avast Antivirus Anti-Malware Shield.
Disabling this shield or setting Freelancer as exception in the shield settings solved the issue.

Hope this helps someone





[+]Signature:
►BattleZones
►Ore Mining
►Sci Data Anomaly "Mining"
►Sci Data Rewards
►POB
►POB Rules
►Bretonia ►Gallia ►Kusari ►Liberty ►Rheinland | ►Model/Name/Move
►MultiMonitor Setup - noBorderWindow
►BBCode
Reply  
Offline Xenon
05-25-2021, 04:19 AM, (This post was last modified: 05-25-2021, 04:20 AM by Xenon.)
#2
Member
Posts: 2,327
Threads: 189
Joined: Feb 2016

after taking a print screen, go to desktop and create a new BMP or paint file, then right click on it, then select edit, and cltr+v, then save Wink

[Image: 2aD52st.png]
NEBULA INFORMATION BOT ☆ NEBULA DISCORD SERVER
XENON WEAPONS MARKET ☆ NEBULA GRAND PLAZA ☆ NEBULA TECHNOLOGIES

THE DISCOVERY POBCAST ☆ DISCOVERY SERVER RULES

Reply  
Offline ronillon
05-25-2021, 04:21 AM,
#3
Copper Storage Depot
Posts: 563
Threads: 19
Joined: Oct 2012

You can also CTRL+V to Discord or other apps.





[+]Signature:
►BattleZones
►Ore Mining
►Sci Data Anomaly "Mining"
►Sci Data Rewards
►POB
►POB Rules
►Bretonia ►Gallia ►Kusari ►Liberty ►Rheinland | ►Model/Name/Move
►MultiMonitor Setup - noBorderWindow
►BBCode
Reply  
Offline Xenon
05-25-2021, 04:24 AM,
#4
Member
Posts: 2,327
Threads: 189
Joined: Feb 2016

(05-25-2021, 04:21 AM)ronillon Wrote: You can also CTRL+V to Discord or other apps.

Thats amazing!

[Image: 2aD52st.png]
NEBULA INFORMATION BOT ☆ NEBULA DISCORD SERVER
XENON WEAPONS MARKET ☆ NEBULA GRAND PLAZA ☆ NEBULA TECHNOLOGIES

THE DISCOVERY POBCAST ☆ DISCOVERY SERVER RULES

Reply  
Offline Save My Soul
05-26-2021, 10:15 AM,
#5
Kittens & Hatred
Posts: 578
Threads: 40
Joined: Feb 2013

Or you can just press Win+PrtScr if you're using Windows 10. And you'll find that images in "...\Pictures\Screenshots".

[Image: sig-gitto-gudo-da-da.png]
  Reply  
Offline sindroms
05-26-2021, 01:26 PM,
#6
Member
Posts: 9,434
Threads: 985
Joined: Feb 2008

How on earth did you manage to break this...

--------------
PSA: If you have been having stutter/FPS lag on Disco where it does not run as smoothly as other games, please look at the fix here: https://discoverygc.com/forums/showthrea...pid2306502
----------
Reply  
Online Laz
05-26-2021, 01:40 PM,
#7
(Sorta) Retired Code Monkey
Posts: 1,897
Threads: 105
Joined: Jan 2014

If you can convince @Alex. to implement this, here is some code wrote that makes print screen not use the stupid FL system, and instead takes nice .png files that are properly categorised by date.

Code:
#define min std::min
#define max std::max
#include <gdiplus.h>
#undef min
#undef max


    using namespace Gdiplus;

    int GetEncoderClsid(const WCHAR* format, CLSID* pClsid)
    {
        UINT  num = 0;          // number of image encoders
        UINT  size = 0;         // size of the image encoder array in bytes

        ImageCodecInfo* pImageCodecInfo = nullptr;

        GetImageEncodersSize(&num, &size);
        if (size == 0)
            return -1;  // Failure

        pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
        if (pImageCodecInfo == nullptr)
            return -1;  // Failure

        GetImageEncoders(num, size, pImageCodecInfo);

        for (UINT j = 0; j < num; ++j)
        {
            if (wcscmp(pImageCodecInfo[j].MimeType, format) == 0)
            {
                *pClsid = pImageCodecInfo[j].Clsid;
                free(pImageCodecInfo);
                return j;  // Success
            }
        }
        free(pImageCodecInfo);
        return -1;  // Failure
    }


    DWORD PrintScreen()
    {
        char directory[MAX_PATH];
        if (!GetScreenShotPath(directory))
        {
            return DWORD(-1);
        }

        // get the device context of the screen
        HDC hScreenDC = GetDC(nullptr);

        // and a device context to put it in
        HDC hMemoryDC = CreateCompatibleDC(hScreenDC);

        int width = GetDeviceCaps(hScreenDC, HORZRES);
        int height = GetDeviceCaps(hScreenDC, VERTRES);

        // maybe worth checking these are positive values
        HBITMAP hBitmap = CreateCompatibleBitmap(hScreenDC, width, height);

        // get a new bitmap
        HBITMAP hOldBitmap = HBITMAP(SelectObject(hMemoryDC, hBitmap));

        BitBlt(hMemoryDC, 0, 0, width, height, hScreenDC, 0, 0, SRCCOPY);
        hBitmap = (HBITMAP)SelectObject(hMemoryDC, hOldBitmap);

        std::time_t rawtime;
        std::tm* timeinfo;
        char buffer[80];

        std::time(&rawtime);
        timeinfo = std::localtime(&rawtime);

        std::strftime(buffer, 80, "%Y-%m-%d", timeinfo);
        std::puts(buffer);

        std::string dir = std::string(directory) + "/" + std::string(buffer) + "/";
        std::filesystem::create_directories(dir);

        std::strftime(buffer, 80, "%H-%M-%S", timeinfo);
        std::puts(buffer);
        std::string file = std::string(buffer) + ".png";

        GdiplusStartupInput gdiplusStartupInput;
        ULONG_PTR gdiplusToken;
        GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, nullptr);
        Bitmap* image = new Bitmap(hBitmap, nullptr);

        CLSID myClsId;
        GetEncoderClsid(L"image/png", &myClsId);

        Status status = image->Save((WCHAR*)Utils::String::stows(dir + file).c_str(), &myClsId, nullptr);
        delete image;

        GdiplusShutdown(gdiplusToken);

        // clean up
        DeleteDC(hMemoryDC);
        DeleteDC(hScreenDC);

        return DWORD(-1);
    }
    
    void HackPrintScreen()
    {
        #define PrintScreenEntryPoint ((PBYTE)0x425170)
        ProtectExecuteReadWrite(PrintScreenEntryPoint, 5);
        PrintScreenEntryPoint[0] = 0xe9;
        *(DWORD*)(PrintScreenEntryPoint + 1) = PBYTE(PrintScreen) - PrintScreenEntryPoint - 5;
    }

Reply  
Offline Kauket
05-26-2021, 01:43 PM,
#8
Dark Lord of the Birbs
Posts: 6,533
Threads: 505
Joined: Nov 2014
Staff roles:
Art Developer

(05-26-2021, 01:26 PM)sindroms Wrote: How on earth did you manage to break this...

It stopped working for me the other day too. Just printed out only black screens or not taking anything at all. I thought it was because of my tv connected via hdmi shut off. The screen goes black for a blink of a moment

[Image: kauket.gif]
Reply  
Offline Hokan
05-26-2021, 01:43 PM,
#9
Purple-eyed Basilica
Posts: 514
Threads: 50
Joined: Dec 2019

Alternatively, If you're using Win 10 you can press and hold the keys: WIN+SHIFT+S.
It will freeze your screen so that you can then make a selection which is saved to your clipboard. Then you can paste it and save it.

Censorship sponsored by - Forum Moderators
[Image: zN3U9Lg.png]
Reply  
Offline St.Denis
05-26-2021, 02:26 PM,
#10
Member
Posts: 100,599
Threads: 1,347
Joined: Dec 2011

I have Windows 10 and all I need to do is press PrtSc and the picture is saved in a Freelancer Folder in Pictures.

'I would like to be half as clever as some people like to believe they are'
Life is full of disappointments, it is how we handle them that helps to define us, as a person
Reply  
Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread


Users browsing this thread:
1 Guest(s)



Powered By MyBB, © 2002-2025 MyBB Group. Theme © 2014 iAndrew & DiscoveryGC
  • Contact Us
  •  Lite mode
Linear Mode
Threaded Mode