Hello guys,
I have 2 questions....
1. I don't know what format is the best for saving screenshots in. I have tried .BMP, its good quality, but 5MB per screenshot is just not acceptable.
I have tried .JPG, but quality is too low. TGA is crap (you need apple quicktime crappy viewer which costs money, also too big in size).
I was thinking about PNG? Is it good format in both, quality and size, but I am wondering about compatibility...
a) Is it supported by all versions of windows Image Viewer? Is it compatible with also older versions of Windows Explorer? Does it have any limitations?

2. I make screenshots save as hour/minute/second (day/month/year).
I would like to use ":" between hour, minute etc, but I cant, since Windows does not let filename include ":".
So, instead of 15:47:12 what could it be so people wouldnt be confused and understand its time info...

Thanks in advance,

Jan

Dani AI

Generated

A few practical points that build on ’s tip and on what tried.

PNG is the best default for UI screenshots: lossless, preserves crisp text/lines and alpha, and typically far smaller than BMP for flat-color content. JPEG is only appropriate when the image is photographic (and you accept compression artifacts). On Windows you can write PNGs from C++ via GDI+ (simple if you already capture an HBITMAP), or use libraries such as libpng, stb_image_write or FreeImage if you need more control.

Windows filenames cannot contain these characters: < > : " / \ | ? * (and control characters 0–31). Colon is specifically used by NTFS for alternate data streams, which is why it’s disallowed in names. Also avoid trailing spaces/periods and reserved names like CON, PRN, AUX, NUL, COM1..COM9, LPT1..LPT9. For predictable sorting and no ambiguity, use an ISO-like timestamp in the name, for example: 3DMV_20090128_194903.png or 2026-02-28_15-47-12.png. That keeps filenames sortable, readable, and script-friendly (no spaces or parentheses).

Small C++ example to create a safe timestamped filename:

#include <ctime>
char buf[64];
std::time_t t = std::time(nullptr);
std::strftime(buf, sizeof(buf), "%Y-%m-%d_%H-%M-%S", std::localtime(&t));
std::string filename = std::string("screenshot_") + buf + ".png";

If a particular viewer refuses to open a PNG: verify the file extension matches the actual format (not a misnamed BMP), check the encoder/library produced a valid PNG, and try opening in Paint as a quick sanity check. If you need even smaller screenshots without losing text clarity, use PNG-8 (paletted) or run a lossless PNG optimizer after saving.

Recommended Answers

All 5 Replies

Yes, PNG is a good format.
Yes, you will have compatibility problems with standard MS tools if you go far enough back in versions.

> So, instead of 15:47:12
Maybe HH_MM_SS format ?

Thanks salem,

I will try .png, (even if Windows Vista image viewer cant load it). Paint opens it perfectly, so its OK.

HH_MM_SS isnt very helpful. I decided to save as:
3DMV_194903 (28-01-2009)
As you can see, its 3DMV_HHMMSS (date).
I think it doesnt really matter the filename, since screenshot thumb tells everything.

Do you know any place where I could get cool screenshot making sound?

NVM, I wont complicate with sounds...

Vista will be fine.
I thought you meant something like W2K or 98.
Find libpng to do all the heavy work, it should be pretty easy from there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.