Skip to main content
GogetaX
Inspiring
April 6, 2018
Answered

CC 2018, Air php/jpeg encoding?

  • April 6, 2018
  • 2 replies
  • 430 views

Hello everyone!

I am building a small project where i can make a snapshot and send it to my server using php communication.

I am pretty much done with everything that belongs to php and Actionscript 3.0 on my app.

But i do have problem, i have looked for an example of how to encode my bitmapData into PNG or JPG, non of those examples seems to be working becasue flash could not find those libraries when i compiling..

wich are:

com.adobe.images.PNGEncoder;

com.adobe.images.JPEGEncoder;

are those libraries not supposed to be in flash CC 2018? or do i need to download it from somewhere?

This topic has been closed for replies.
Correct answer zwetan_uk

Look at BitmapData.encode() method

you will be able to chose a compressor for either PNG, JPG or JPGX
you will have to use min AIR 3.3 / Flash 11.3

2 replies

Colin Holgate
Inspiring
April 6, 2018

For your interest, there were old encoder classes, that may be what you found as example code. The newer encoder is a lot faster.

zwetan_ukCorrect answer
Inspiring
April 6, 2018

Look at BitmapData.encode() method

you will be able to chose a compressor for either PNG, JPG or JPGX
you will have to use min AIR 3.3 / Flash 11.3