Package flash.swf.types

Examples of flash.swf.types.Matrix


    DefineShapeBuilder builder = new DefineShapeBuilder(shape, graphicContext, draw, fill);

    DefineShape ds3 = (DefineShape)builder.build();
    defineTags.defineShape3(ds3);

    Matrix matrix;

    if (isGradient)
    {
      double originX = graphicContext.getPen().getX();
      double originY = graphicContext.getPen().getY();
View Full Code Here


        return g;
    }

    private Matrix decodeMatrix() throws IOException
    {
        Matrix m = new Matrix();

        r.syncBits();
        m.hasScale = r.readBit();
        if (m.hasScale)
        {
View Full Code Here

        if (Double.isNaN(height))
            height = tag.height;

        // Create Fill Style
        Matrix matrix = new Matrix();
        matrix.scaleX = (int)(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.scaleY = (int)(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.hasScale = true; // Apply runtime scale of 20x for twips
       
        FillStyle fs = null;
View Full Code Here

        ShapeWithStyle sws = new ShapeWithStyle();
        sws.fillstyles = new ArrayList<FillStyle>(9);
        sws.shapeRecords = shapeRecords;

        // Apply runtime scale of 20x for twips
        Matrix matrix = new Matrix();
        matrix.scaleX = (int)(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.scaleY = (int)(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.hasScale = true;

        // Create 9 identical fillstyles as a work around
View Full Code Here

    {
    }

    private Matrix parseMatrix(String s)
    {
        Matrix matrix = new Matrix();
        for (int i = 0; i < s.length(); i++)
        {
            char c = s.charAt(i);
            switch (c)
            {
                case 'r':
                    i++;
                    String[] parts = StringUtils.split(s.substring(i), "[, ]", 3);
                    matrix.setRotate(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]));
                    break;
                case 's':
                    i++;
                    parts = StringUtils.split(s.substring(i), "[, ]", 3);
                    matrix.setScale(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]));
                    break;
                case 't':
                    i++;
                    parts = StringUtils.split(s.substring(i), "[, ]", 3);
                    matrix.translateX = Integer.parseInt(parts[0]);
View Full Code Here

    {
    }

    public static Matrix build(AffineTransform at)
    {
        Matrix matrix = new Matrix();
        matrix.scaleX = (int)Math.rint(at.getScaleX() * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.scaleY = (int)Math.rint(at.getScaleY() * SwfConstants.FIXED_POINT_MULTIPLE);
        if (matrix.scaleX != 0 || matrix.scaleY != 0)
            matrix.hasScale = true;

View Full Code Here

        return matrix;
    }

    public static Matrix getTranslateInstance(double tx, double ty)
    {
        Matrix matrix = new Matrix();
        matrix.translateX = (int)Math.rint(tx * SwfConstants.TWIPS_PER_PIXEL);
        matrix.translateY = (int)Math.rint(ty * SwfConstants.TWIPS_PER_PIXEL);
        return matrix;
    }
View Full Code Here

              DefineBitsLossless tag = DefineBitsLosslessBuilder.build(losslessImage.getPixels(), imageWidth, imageHeight);

        //Apply Twips Scale of 20 x 20
        AffineTransform at = new AffineTransform();
        at.setToScale(SwfConstants.TWIPS_PER_PIXEL, SwfConstants.TWIPS_PER_PIXEL);
        Matrix matrix = MatrixBuilder.build(at);

        fs = new FillStyle(FillStyle.FILL_BITS, matrix, tag);
      }

    }
View Full Code Here

    DefineShapeBuilder builder = new DefineShapeBuilder(shape, graphicContext, draw, fill);

    DefineShape ds3 = (DefineShape)builder.build();
    defineTags.defineShape3(ds3);

    Matrix matrix;

    if (isGradient)
    {
      double originX = graphicContext.getPen().getX();
      double originY = graphicContext.getPen().getY();
View Full Code Here

      DefineShape ds3 = ImageShapeBuilder.buildImage(defineBits, image.getWidth(), image.getHeight());
      taglist.defineShape3(ds3);

      PlaceObject po2 = new PlaceObject(ds3, 1);
      po2.setMatrix(new Matrix());
      // po2.setName(name);

      taglist.placeObject2(po2);
    }
    catch (IOException ex)
View Full Code Here

TOP

Related Classes of flash.swf.types.Matrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.