PEAR-Graphics-iOS 1.1.4

PEAR-Graphics-iOS 1.1.4

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2015

Maintained by Hiroki Umatani.



 
Depends on:
PEAR-FileManager-iOS>= 0
PEAR-DataConvertor-iOS>= 0
 

  • By
  • HirokiUmatani

Overview

This library can draw on a canvas in iOS.

Demo Screen

draw_canvas_demo

Installation

pod 'PEAR-Graphics-iOS'

Usage

□import
#import "PEARGraphics.h"
□create instance
PEARCanvas *_canvas = [[PEARCanvas alloc] initWithFrame:self.view.frame
                                         onView:self.view
                                          index:0];
□draw
- (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];
}
□save
    [_canvas save];
□fatch save List data
    [_canvas fetchSaveData];
□fatch save image data
    [_canvas fetchSaveDataAtIndex:0];
□redo
    [_canvas redo];
□undo
    [_canvas undo];

Document

document library

Licence

MIT

Author

Hiroki Umatani