Simply stated, I'm looking for a PNG encoder that will directly convert a RGB/RGBA ByteArray
into a PNG file also stored in a ByteArray
without making use of the BitmapData
class at all. I'm currently working on a ~v4.0 Scaleform Gfx project - which doesn't support any of the Get/SetPixel methods.
Asked
Active
Viewed 54 times
0

Digital_Utopia
- 816
- 8
- 17
-
This? https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/graphics/codec/PNGEncoder.html#encodeByteArray() – Organis Feb 25 '20 at 19:00
1 Answers
0
If you're using Scaleform 4.0, then likely your best solution is to bind the ByteArray
in question to a GFx::Value
in C++, via an ExternalInterface
call. With the GFx::Value
, you can use ReadByteArray
, WriteByteArray
, etc.
Scaleform 4.0 by default has a PNG reader/writer built in, Scaleform::Render::PNG::FileReader/FileWriter
. These basically just wrap libpng
functionality. You can use Scaleform::MemoryFile
to wrap the incoming/outgoing bytes, so they can use this interface.
Alternatively, if you'd like to use the BitmapData
API, you could upgrade to the final version of Scaleform, which is available from Autodesk support for free, assuming you have a valid license.

MuertoExcobito
- 9,741
- 2
- 37
- 78