项目介绍:
项目介绍:
仓库地址: https://github.com/MakeHui/MHWhiteboard
使用:
- #import <MHWhiteboard/MHWhiteboard.h>
- MHWhiteboardView *whiteboardView = [[MHWhiteboardView alloc] initWithFrame:CGRectMake(0, 0, 375, 500)];
- [whiteboardView setBrushColor:[UIColor redColor]]; // 设置画笔颜色
- [whiteboardView setBrushWidth:10.0f]; // 设置画笔宽度
- [whiteboardView setForegroundImage:[UIImage new]]; // 设置前景图片
- [whiteboardView setBackgroundImage:[UIImage new]]; // 设置背景图片
- [whiteboardView undo]; // 撤销
- [whiteboardView repeat]; // 回撤
- [whiteboardView clearBackgroundImage]; // 清除背景图片
- [whiteboardView clearAll]; // 清空白板
- // Set current tool
- typedef NS_OPTIONS(NSUInteger, MHPathModelAction) {
- MHPathModelActionLine = 1 << 16,
- MHPathModelActionStraightLine = 1 << 17,
- MHPathModelActionCircle = 1 << 18,
- MHPathModelActionRectangle = 1 << 19,
- MHPathModelActionPolygon = 1 << 20,
- MHPathModelActionText = 1 << 21,
- // MHPathModelActionSmear = 1 << 22,
- // MHPathModelActionMosaic = 1 << 23,
- };
- whiteboardView.pathModelAction = MHPathModelAction;
复制代码