On Sun, 11 Oct 2015, Ryan Joseph wrote:
On Oct 11, 2015, at 1:53 PM, Michael Van Canneyt <mich...@freepascal.org> wrote:
You can use the fpimage and fpreadpng units. Check the packages/fcl-image
sources. There is a small demo program that shows how to do it.
I see you can load an image as TFPCustomImage with TFPCustomImageReader then
there is a canvas class (TFPCustomCanvas) which I assume I could draw the
TFPCustomImage into and expose the pixels as a pointer to memory which I could
then use to make the OpenGL texture.
You don't need TFPCustomCanvas.
TFPCustomImage is an abstract image class, it provides no storage for the data.
It can have several descendants such as TFPMemoryImage and TFPCompactImgRGBA8Bit.
If you just want the raw data, create a TFPMemoryImage and access the Colors
array property.
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal