Package flash.swf.types

Examples of flash.swf.types.Matrix


        FXGMatrix newm = new FXGMatrix(a, b, c, d, tx, ty);
        if (!newm.invert())
            throw new FXGException("MatrixNotInvertible");
        */
       
        Matrix sm = new Matrix();
        if (b != 0 || c != 0)
            sm.hasRotate = true;       
        if (a != 0 || d != 0)
            sm.hasScale = true;
        sm.scaleX = (int) (a * SwfConstants.FIXED_POINT_MULTIPLE);
 
View Full Code Here


        Frame frame = new Frame();
        movie.frames = new ArrayList<Frame>();
        movie.frames.add(frame);

        PlaceObject po3 = new PlaceObject(Tag.stagPlaceObject3);
        po3.matrix = new Matrix();
        po3.setRef(sprite);
        po3.depth = depth;
        frame.controlTags.add(po3);

        TagEncoder tagEncoder = new TagEncoder();
View Full Code Here

            List<Filter> filters = createFilters(context.filters);
            po3.setFilterList(filters);
        }

        // FXG angles are always clockwise.
        Matrix matrix = context.getTransform().toSWFMatrix();
        po3.setMatrix(matrix);

        if (context.colorTransform != null)
        {
            ColorTransformNode t = context.colorTransform;
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

    {
    }

    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 DefineShape buildImage(DefineBits tag, int width, int height)
    {
        // Create Fill Style
        Matrix matrix = new Matrix();
        matrix.scaleX = (int)Math.rint(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.scaleY = (int)Math.rint(SwfConstants.TWIPS_PER_PIXEL * SwfConstants.FIXED_POINT_MULTIPLE);
        matrix.hasScale = true; //Apply runtime scale of 20 (for twips)
        FillStyle fs = new FillStyle(FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP, matrix, tag);

View Full Code Here

    }

    public DefineTag build()
    {
        if (tag.matrix == null)
            tag.matrix = new Matrix();

        return 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

              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

            tag.shapeWithStyle = sws;

            //Create a SWF Movie shell
            Movie m = getMovie(1);
            Frame frame1 = (Frame)m.frames.get(0);
            Matrix mt = new Matrix(0, 0);
            frame1.controlTags.add(new PlaceObject(mt, tag, 1, null));

            //Compile SWF
            TagEncoder tagEncoder = new TagEncoder();
            MovieEncoder movieEncoder = new MovieEncoder(tagEncoder);
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.