Calculate a pan/zoom transformation matrix in Adobe Flex/Flash/Air
ActionScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
author
example
src/yzzy/projection
t
.gitignore
README.example
README.md
SYNOPSIS

README.md

yzzy.projection.View

Calculate a pan/zoom transformation matrix in Adobe Flex/Flash/Air

SYNOPSIS

import yzzy.projection.View

...

var view:View = new View( 
    viewport.width, viewport.height,
    image.width, image.height
);

// Center viewport with image
view.center();

view.translate( 240, 100 );
view.scale = 1.6;

var transform:Matrix = view.transformationMatrix();

// Begin the rendering on the panned and zoomed result:
var graphics:Graphics = viewport.graphics;
graphics.clear()
graphics.beginBitmapFill( bitmapData, transform, false, true );
graphics.drawRect( 0, 0, view.width, view.height );
graphics.endFill();

// Cover up any "exposed" border as a result of zooming out
view.renderBorder( function():void {
    graphics.beginFill( 0xbbbbbb );
    graphics.drawRect( this.left, this.top, this.width, this.height );
} );

DESCRIPTION

yzzy.projection.View is a tool for calculating the transformation matrix (flash.geom.Matrix) when panning and zooming around an image

USAGE/INSTALL

Compile your project with the following files:

yzzy
`-- projection
        |-- Aperture.as
        `-- View.as

AUTHOR

Robert Krimen <robertkrimen@gmail.com>

http://github.com/robertkrimen/yzzy-projection

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Robert Krimen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system.