Hi, does anyone have an example of using the
ImageSnapshot.captureBitmapData function with a rotation matrix? This
is the code I'm using:

var matrix:Matrix = new Matrix();
matrix.rotate(degreesToRadians(90));
var bitmapData:BitmapData = ImageSnapshot.captureBitmapData(textInput,
matrix);

But unfortunately this throws an error on the following line in
ImageSnapshot.as:

data = new BitmapData(scaledWidth, scaledHeight, true, 0x00000000); //
<-- THROWS ERROR HERE AS scaledWidth / scaledHeight are extremely
small numbers (-1-e16 etc)
            data.draw(source, matrix, colorTransform,
                      blendMode, clipRect, smoothing);
        }
        finally
        {
            if (source is IUIComponent)
                finishPrintObject(IUIComponent(source), normalState);
// <-- ERROR THROWN HERE, BUT CAUSE OF ERROR IS ABOVE
        }

What I'm trying to achieve is a rotated bitmap of a text input control
(I'm trying to avoid embedding a font in the application). This code
works just fine when I don't rotate the bitmap, but the minute I
rotate it, it breaks.

Any help much appreciated.

Mark

Reply via email to