Created
June 13, 2013 01:35
-
-
Save C4Code/5770607 to your computer and use it in GitHub Desktop.
Image Scale add Points
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// david | |
// | |
// Created by moi on 13-06-12. | |
// Copyright (c) 2013 moi. All rights reserved. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Image *img; | |
} | |
-(void)setup { | |
//work your magic here | |
img = [C4Image imageNamed:@"C4Sky"]; | |
[self.canvas addImage:img]; | |
img.center = self.canvas.center; | |
img.userInteractionEnabled = NO; | |
} | |
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
CGPoint p = [[touches anyObject] locationInView:self.canvas]; | |
C4Shape *s = [C4Shape ellipse:CGRectMake(0, 0, 10, 10)]; | |
s.center = p; | |
[self.canvas addShape:s]; | |
} | |
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { | |
CGPoint p = [[touches anyObject] locationInView:self.canvas]; | |
img.width = p.x; | |
img.center = self.canvas.center; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment