Skip to content

robertkrimen/as3-projection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published