测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
Released最后发布 | Dec 2015 |
由 Hiroki Umatani 维护。
依赖项 | |
PEAR-FileManager-iOS | >= 0 |
PEAR-DataConvertor-iOS | >= 0 |
此库可以在 iOS 上的画布上绘制。
pod 'PEAR-Graphics-iOS'
#import "PEARGraphics.h"
PEARCanvas *_canvas = [[PEARCanvas alloc] initWithFrame:self.view.frame
onView:self.view
index:0];
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[_canvas setTouchPointWithTouches:touches];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[_canvas setMovePointWithTouches:touches];
[_canvas drawStart];
[_canvas setPencilWithShape:kCGLineCapRound
thickness:5.0 colorRed:0.0
colorGreen:0.0 colorBlue:0.0
alpha:1.0];
[_canvas draw];
[_canvas drawEnd];
}
[_canvas save];
[_canvas fetchSaveData];
[_canvas fetchSaveDataAtIndex:0];
[_canvas redo];
[_canvas undo];