The following example shows how you can set the ImageSnapshot class’s static defaultEncoder property in Flex 3 to set a default image encoder for captured images.
Full code after the jump.
Continue reading ‘Setting a default encoder for the ImageSnapshot class in Flex 3′
The following example shows how you can use the ImageSnapshot class to capture images as JPEGs or PNGs by setting the encoder parameter in the ImageSnapshot class’s static captureImage() method in Flex 3.
Full code after the jump.
Continue reading ‘Using the ImageSnapshot class to capture images as JPEGs or PNGs in Flex 3′
The following example shows how you can convert an ImageSnapshot object into a Base-64 encoded string using Flex 3’s cleverly named encodeImageAsBase64() method.
Full code after the jump.
Continue reading ‘Converting an ImageSnapshot object into a Base-64 encoded string in Flex 3′
As we saw in a previous entry, “Taking screenshots in Flex 3 using the ImageSnapshot.captureImage() method”, it is possible to take a screenshot of an item on the display list using the static ImageCapture.captureImage() method. Once the image is captured, we accessed the image’s pixel data using the ImageCapture object’s data property, which was displayed using the SWFLoader control.
The ability to load a ByteArray object directly into a SWFLoader was added in Flex 3 build 187814, you may need to update your SDK build by downloading a recent nightly build from http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html.
The following example shows how you can take a snapshot of an item on the display list using the static ImageSnapshot.captureBitmapData() method, which returns a BitmapData object, as seen in the following snippet:
var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(source);
swfLoader.source = new Bitmap(imageBitmapData);
Full code after the jump.
Continue reading ‘Taking screenshots in Flex 3 using the ImageSnapshot.captureBitmapData() method’
The following example shows how you can use the static captureImage() method in the mx.graphics.ImageSnapshot class to take a screenshot of an item on the display list, convert it into a ByteArray, and display the ByteArray using a SWFLoader control.
Full code after the jump.
Continue reading ‘Taking screenshots in Flex 3 using the ImageSnapshot.captureImage() method’