quote:
There it is written - GLUEGEN a file (a mix "C(Alchemy)" and "AS3") with extention *.gg and accordingly all will be on another. Look an example at Metalbot and it Makefile
quote:
We provide a set of library routines for reading and writing JPEG image files,
plus two sample applications "cjpeg" and "djpeg", which use the library to
perform conversion between JPEG and some other popular image file formats..
quote:
package {
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.utils.ByteArray;
import flash.utils.getTimer;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import hurlant.jpeg.as3_jpeg_wrapper;
import com.adobe.images.JPGEncoder;
public class JpegTest extends Sprite {
private var _loader:Loader = new Loader();
public function JpegTest() {
trace("hello.");
testWrite();
}
private function testWrite():void {
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete) ;
_loader.load(new URLRequest("acura.jpg"));
}
public function onComplete(event:Event):ByteArray{
var image:Bitmap = Bitmap(_loader.content);
var b:BitmapData = image.bitmapData;
addChild(image);
// as3 way
var t1:int = getTimer();
var s:JPGEncoder = new JPGEncoder();
var jpg:ByteArray = s.encode(b);
trace("AS3 JPEG ENCODING: "+(getTimer()-t1)+"ms.");
trace("jpg.length = "+jpg.length);
// C way
var t2:int = getTimer();
var ba:ByteArray = b.getPixels(new Rectangle(0,0,320,200));
var ret:ByteArray = as3_jpeg_wrapper.write_jpeg_file(ba, 320, 200, 3, 2);
trace(" C JPEG ENCODING: "+(getTimer()-t2)+"ms.");
trace(" ret.length="+ret.length);
return ret;
}
}
}
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).