I was in assumption there is something for PNG saving made for BGRA, since this topic was about it. I have never used it, so someone else may tell more about it.
But then you said:
is it possible to save 32bit png with FreePascal at all ?
Because there are units deeper in the fpc core, that i suppose BGRA uses too.
For example TPortableNetworkGraphic class, coming from FPimage unit i think. You should go through its procedures to find something useful. Like said few times in this thread, you need to add alpha-channel to the image. Can you simply go and write pixels an alpha value, i don't know. You would have to go through the whole image and add alpha value 65535 (in fpc each pixel channel is internally 2 bytes) to every pixel. I don't know what would happen if you try to add alpha to just 1 pixel; if rest of the image gets value of 0, it would be all transparent.
Lets hope that you don't need to go through to RawImage. Just showing you quick example from my game engine, it's code that reads RawImage from PNG and JPG, and writes it into data array that OpenGL can take:
http://code.google.com/p/nxpascal/source/browse/trunk/src/nxGraph.pas#568Sure there's alot of code you will not need in your program, but 1 interesting thing to note is, that pixel channel sequence is browsed through as bits, not bytes. Because they make support for image formats that would have for example 7 bits per pixel or other odd ones.