Skip to content

HirokiUmatani/PEAR-Graphics-iOS

Repository files navigation

PEAR-Graphics-iOS GitHub license CocoaPods CocoaPods

====

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

GitHub
CocoaPod
FaceBook
Twitter

About

This library can to draw on canvas in iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published