title: UIImage Flip and Mirror
body: <p>I have a UIImage I need to Flip and Mirror. I have done this by using a UIImageView. I have two problems with this. </p>
  
  <ol>
  <li><p>This does not change the image only the view. So, when I use the image it is not flipped or i get an error. </p></li>
  <li><p>If I use the same transform two times it does nothing on the second time. </p></li>
  </ol>
  
  <p>Code Example: ( I am new to IOS programing and am sorry for any bad code.) </p>
  
  <p>Calling the Flip:</p>
  
  <pre><code>// ImageHolder is a UIImageView
  ImageHolder = [self flip:ImageHolder FlipType:@"V"];
  </code></pre>
  
  <p>What it calls: </p>
  
  <pre><code>- (UIImageView *)flip:(UIImageView *) fvImageView FlipType:(NSString *)FlipType { 
  
      UIImageView *newView =  [[UIImageView alloc] init];
      newView = fvImageView;
      if ( FlipType == @"V"){
          newView.transform = CGAffineTransformMakeScale(-1, 1);
      } else if ( FlipType == @"H"){
          newView.transform = CGAffineTransformMakeScale(1, -1);
      }else if ( FlipType == @"VH"){
          newView.transform = CGAffineTransformMakeScale(-1, -1);   
      }else if ( FlipType == @"N"){
          newView.transform = CGAffineTransformMakeScale(1, 1);
      }
      return newView;
      [newView release]; newView= nil;
  }
  </code></pre>
  
  <p>Thanks for any help you can give!</p>