OpenXcom Forum

OpenXcom => Suggestions => Topic started by: moriarty on September 01, 2012, 08:40:59 pm

Title: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: moriarty on September 01, 2012, 08:40:59 pm
it would be really nice if the screendumps that you can so conveniently create in openxcom using the F12 key could actually be posted here without having to convert them... just saying.
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 03, 2012, 06:04:38 pm
no need convert.
only rename extension

screen000x.bmp -> screen000x.jpg
screen000x.bmp -> screen000x.png


attach. test:  .bmp > .jpg / .bmp > .png
---
EDIT
btw. rename in game .bmp > .jpg or .png work 100% on winxp32
Screen.cpp
Code: [Select]
ss << Options::getUserFolder() << "screen" << std::setfill('0') << std::setw(3) << i << ".bmp";
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: moriarty on September 03, 2012, 06:30:36 pm
Seriously? Come on. Okay, it kind of makes sense - the forum simply checks for supported extension, the browser displays anyway... but that's a really, really cheap workaround, wouldn't you agree?  ;D

Considering the un-compressedness of .bmp it is of course easy to use as a screen dump. But I'd still prefer one of my two options from the thread title  8)
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 03, 2012, 06:55:04 pm
really cheap workaround, wouldn't you agree?  ;D
yes ;)

You want to add .bmp to the option of the enclosures of the forum?
Or alter .bmp on .png in the code of the game?
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: moriarty on September 03, 2012, 07:14:05 pm
Either would be nice for error reporting... but saving directly to .png would be more elegant in the long run.
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 03, 2012, 08:23:05 pm
the only change in the game ".bmp" on ".png" he does not influence the size of the saved screenshot file...
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: michal on September 03, 2012, 08:37:44 pm
I've allowed attaching .bmp files, so you don't need to rename files ;)

On the long run it would be better of course to save screendumps in png.
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: moriarty on September 03, 2012, 08:39:03 pm
Thank you michal!
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 03, 2012, 08:55:19 pm
:)
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Volutar on September 03, 2012, 09:38:56 pm
Are you kidding? 346kb BMP instead of 4kb png - is an alternative?
Haven't heard of something more lame than that...

You may rename it even into .TXT or even .WAV - it will stay .BMP file...
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 03, 2012, 09:58:13 pm
You are right. What "alternative"?
I also think that you did not understand the whole conversation.

Quote
Either would be nice for error reporting... but saving directly to .png would be more elegant in the long run.
Quote
the only change in the game ".bmp" on ".png" he does not influence the size of the saved screenshot file...

The problem related to placing .bmp screenshots on the forum. He was solved by Michal [forum options].
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: SupSuper on September 04, 2012, 01:34:28 am
I'm definitely removing BMP support from the forum as soon as OpenXcom doesn't use it anymore, it's horrifying! (some forums even automatically convert them)

Anyways I have had the code for outputting screenshots in PNG for a while, it's just a matter of figuring out how to tie up all the required libraries to OpenXcom. I mean have you looked at the PNG website (https://www.libpng.org/pub/png/)? It's like something out of the 80s! :P
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: radius75 on September 04, 2012, 01:59:33 am
 ;D
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Daiky on September 04, 2012, 10:39:54 am
And once the required libraries are linked into openxcom (I thought it was only zlib and libpng?) then it's only a small step to load sprites from PNG  8)
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: michal on September 04, 2012, 11:08:38 am
Small step for developer, a giant leap for modders :)
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Volutar on September 04, 2012, 11:14:20 am
Daiky, there is an alternative to libpng, without any dll/so and zlib... https://lodev.org/lodepng/
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: moriarty on September 04, 2012, 11:50:39 am
+1  ;D
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: luke83 on September 05, 2012, 10:16:11 am
Doesn't UFO2000 use PNG ? Will Openxcom be compatible with Ufo2000 Items ?  What Program do they use to save it all ( someone here must of used UFO2000 before )?
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Volutar on September 06, 2012, 09:34:29 am
LodePNG library work like a charm. Just tested it.
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Daiky on September 06, 2012, 12:18:27 pm
LodePNG library work like a charm. Just tested it.
Interesting, the developer seems to be from Belgium even :) But I don't know him :p
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Volutar on September 06, 2012, 04:01:42 pm
It's quite easy to use. The only thing I was puzzled with is... getting png info on alpha channel before loading, in order to load in in proper form - RGB or RGBA. Of course it was solved.
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: Volutar on September 07, 2012, 06:13:34 pm
I've added PNG functionality into my dead project (https://volutar.eu5.org/bd.zip). Textures are in PNG, and screenshots are in PNG as well. With quite an ease...
Title: Re: (F12) screendumps in .png format https:// forum support for .bmp ?
Post by: SupSuper on September 07, 2012, 07:26:19 pm
Daiky, there is an alternative to libpng, without any dll/so and zlib... https://lodev.org/lodepng/
Wow that was surprisingly handy, I implemented PNG screenshots with just a few lines. :)

And once the required libraries are linked into openxcom (I thought it was only zlib and libpng?) then it's only a small step to load sprites from PNG  8)
Loading the graphics into OpenXcom isn't the hard part (SDL_image can do loading fine, it just can't save for some reason), it's just externalizing all the resource loading stuff, and you saw how long that took just for the ruleset. :P