Rotate an Image

From $1
    Table of contents

    If you want to rotate an image around an arbitary point, you can make use of CGAffineTransform and it's MakeRotation method. This takes the angle in radians and then rotates the view to which it is applied.

    For example to rotate an image approximately 30 degrees:

    UIImageView imageView = new UIImageView (
                                 new RectangleF(50,50, 250, 250)
                                 );
    
    imageView.Image = UIImage.FromFileUncached("/<path.to.image>/<image.name>");
    imageView.Transform = CGAffineTransform.MakeRotation(0.5f);

     

    Tag page
    • No tags

    Files (0)

     
    Page last modified 13:33, 27 Oct 2009 by OwenRW