Giter Site home page Giter Site logo

acedrawingview's People

Contributors

acerbetti avatar adamdehaven avatar alexruperez avatar bogaevskyi avatar devkaranstl avatar erbittuu avatar frog-frog avatar gbarnett-cs avatar hezhk3 avatar joelfischerr avatar master-nevi avatar rahulsom avatar readmecritic avatar rlustemberg avatar stefanoacerbetti-alation avatar stephengazzard avatar stevelandeyasana avatar vtourraine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acedrawingview's Issues

run's in iOS 8?

I have a project with ACEDrawingView, but it not run with iOS8. How do I?
Thanks.

How to draw text using this tool?

Hello @acerbetti I would like to know if there is any option to draw text using the ACEDrawingView. All your other tools work amazing for me but I want to know how we can draw text in a rect. Can you please help me with this?

I have been pointing to 1.3.2 for months

Now suddenly when I do pod update. it gets 1.3.5 and screwing up my project. all drawing are screwed. can you tell me what is going on ?
Its error on my side or ACEDrawingView Side

Update : I just confirmed that 1.3.5 is broken for Retina displays. I just plugged in 1.3.2 manually in project and everything started to working out of the box.
I am not sure if someone already created issue for retina vs non retina displays. if not please consider this as one.

Make CGMutablePathRef publicly available

It would be nice if you could access the CGMutablePathRef of the ACEDrawingPenTool from the outside (e.g. to store it in a database).

I suggest overriding the CGPath accessor defined by UIBezierPath to do this. This should make things easy, because UIBezierPath conforms to NSCoding, so everything should work out-of-the-box.

I'll see if I find some time to format a PR to accomplish this.

Initial content

I am trying to use you code to expand a simple app I'm working on. This code is really helpful!!!!

Questions: I'm saving the image to file and then reloading it. The problem I'm running into is setting the ACEDrawingView image with default content. It assumes an empty drawing surface. Is there something I'm missing? Did you allow for initial content?

I changed the code to allow (removed read-only setting on image in ACEDrawingView). I then set it in viewDidLoad of the controller class. This sort-of works. The image loads from file just fine. The problem is as soon as I draw on the image, it zooms out and moves the image down-and-to-the-right. This isn't ideal (obviously). Any ideas on how to make this more flexible (and still work)?

Rotating the ACEDrawingView will break the doodle

Hiya there.
Thanks for the cool project.
I got a small problem with this. When I draw in Portrait mode and then switch to Landscape and continue drawing I get a broken image. This mostly happens when I draw at previously unreachable positions. There will be white fragments around the new lines I am drawing.

Did anybody experience this before and has an idea what to do bout this?

Thx in advance!

How can I integrate this API with swift file?

I had integrate this API in swift, issue comes with delegate call from:

  1. ACEDrawingView.m
  2. - (void)finishDrawing
  3. delegate call, doesnot goe inside "if" condition,

Definition of delegate given in swift file, but call is not made.

Please help. Consider it as urgent!

loadImage() issue on retina iPad

Hi, thanks for sharing this code. It's a great little tool.
I wanted to use this code for a simple colouring-in tool for kids but I'm having issues with it on retina ipads. I'm loading a UIImage into ACEDrawingView with the loadImage:(UIImage *)image method but once I start drawing with the brush I noticed the original uiimage starts to get messed up. Looks like the drawRect is painting the wrong area of the original image on retina displays only. (You have to paint a few longs lines before you see it).

Am I just using the code wrong?

Erratic Drawing Disappears

Sometimes when drawing erratically, the pen stops working. Other times when drawing for a prolonged period of time, the drawing disappears. Could someone please explain what's happening, and how to fix it? Thanks - Adam

Brush support

Hi,

Is possible to add brush support for this? -.-

Save the drawing and open it again

many thanks for this great sample project.
I want to ask if you can give me a tip. I want to save the drawn lines, shapes, etc.. I do not mean save as png or pdf. Rather, I want to save the contents of the "self.pathArray" and load this data later in the "drawingView". Later the drawing is to be further processed. If there still remain the UnDo steps, it would be perfect.

I try and try ... but do not get ahead.
it would be great if you could help me.
sincerely thomas.

currentTool is set to nil

In ACEDrawingView ( touchesEnded method) currentTool is set to nil currentTool and then it is sent in the delegate method

 // clear the current tool
    self.currentTool = nil;

    // clear the redo queue
    [self.bufferArray removeAllObjects];

    // call the delegate
    if ([self.delegate respondsToSelector:@selector(drawingView:didEndDrawUsingTool:)]) {
        [self.delegate drawingView:self didEndDrawUsingTool:self.currentTool];
    }

undo, redo

Optimization please (undo, redo)
draws a lot of Fig.-> undo or redo -> speed is very slow

Swift advice

This is a great control, but I want something in Swift. Can you recommend an equivalent? Alternatively, some detail of how to integrate in a large Swift project would be really appreciated.

very laggy

Hi

i tried the demo out on my iPad 3, and as i draw, the line being drawn falls way behind from where my finger is.

Im guessing this is because the drawing is redrawing every line and shape over and over, instead of just drawing the current draw item?

Oz

how to save drawing ?

Hi,
I want to save drawing ,when I finish drawing. I can open it again.Please tell me how to do it .Look forward to your reply .Thanks!

Build errors in Xcode 6.1

Hi there

I've just discovered your component, but I'm having trouble using it. Following your instructions, I import the ACEDrawingView folder into my (completely new) project. If I try and compile now, the build fails. I'm pretty much at a loss; the demo project works just fine, and I can't see any configuration differences between the two.

Here's the compiler dump:
CompileC /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/Objects-normal/x86_64/ACEDrawingTools.o DrawingTest/ACEDrawingView/ACEDrawingTools.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/drdaz/Desktop/DrawingTest
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-cache-path=/Users/drdaz/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DrawingTest-generated-files.hmap -I/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DrawingTest-own-target-headers.hmap -I/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DrawingTest-all-target-headers.hmap -iquote /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DrawingTest-project-headers.hmap -I/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Products/Debug-iphonesimulator/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DerivedSources/x86_64 -I/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/DerivedSources -F/Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/Objects-normal/x86_64/ACEDrawingTools.d --serialize-diagnostics /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/Objects-normal/x86_64/ACEDrawingTools.dia -c /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m -o /Users/drdaz/Library/Developer/Xcode/DerivedData/DrawingTest-cwkxsajnlrcqvzglxvjlddpaxzzb/Build/Intermediates/DrawingTest.build/Debug-iphonesimulator/DrawingTest.build/Objects-normal/x86_64/ACEDrawingTools.o

In file included from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:26:
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:44:31: error: unknown type name 'UIColor'
@property (nonatomic, strong) UIColor *lineColor;
^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:44:1: error: property with 'retain (or strong)' attribute must be of object type
@property (nonatomic, strong) UIColor *lineColor;
^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:45:31: error: unknown type name 'CGFloat'
@property (nonatomic, assign) CGFloat lineAlpha;
^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:46:31: error: unknown type name 'CGFloat'
@property (nonatomic, assign) CGFloat lineWidth;
^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:48:26: error: expected a type

  • (void)setInitialPoint:(CGPoint)firstPoint;
    ^
    /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:49:24: error: expected a type
  • (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint;
    ^
    /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:49:52: error: expected a type
  • (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint;
    ^
    /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:57:32: error: cannot find interface declaration for 'UIBezierPath', superclass of 'ACEDrawingPenTool'
    @interface ACEDrawingPenTool : UIBezierPath {
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:58:5: error: unknown type name 'CGMutablePathRef'; did you mean 'CFMutableDataRef'?
    CGMutablePathRef path;
    ^~~~~~~~~~~~~~~~
    CFMutableDataRef
In module 'Foundation' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:26:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h:14:66: note: 'CFMutableDataRef' declared here
typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableData) __CFData * CFMutableDataRef;
                                                                 ^
In file included from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:26:
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:61:4: error: expected a type
- (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint;
   ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:61:41: error: expected a type
- (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint;
                                        ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:61:76: error: expected a type
- (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint;
                                                                           ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:61:110: error: expected a type
- (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint;
                                                                                                             ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:40:17: warning: auto property synthesis will not synthesize property 'lineWidth' declared in protocol 'ACEDrawingTool' [-Wobjc-protocol-property-synthesis]
@implementation ACEDrawingPenTool
                ^
In file included from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:26:
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:46:39: note: property declared here
@property (nonatomic, assign) CGFloat lineWidth;
                                      ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:40:17: warning: auto property synthesis will not synthesize property 'hash' declared in protocol 'NSObject' [-Wobjc-protocol-property-synthesis]
@implementation ACEDrawingPenTool
                ^
In module 'Foundation' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:26:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:
In module 'os' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:
In module 'ObjectiveC' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/object.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/objc/NSObject.h:18:33: note: property declared here
@property (readonly) NSUInteger hash;
                                ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:40:17: warning: auto property synthesis will not synthesize property 'superclass' declared in protocol 'NSObject' [-Wobjc-protocol-property-synthesis]
@implementation ACEDrawingPenTool
                ^
In module 'Foundation' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:26:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:
In module 'os' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:
In module 'ObjectiveC' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/object.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/objc/NSObject.h:20:28: note: property declared here
@property (readonly) Class superclass;
                           ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:40:17: warning: auto property synthesis will not synthesize property 'description' declared in protocol 'NSObject' [-Wobjc-protocol-property-synthesis]
@implementation ACEDrawingPenTool
                ^
In module 'Foundation' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.h:26:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In module 'Dispatch' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15:
In module 'os' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/dispatch/dispatch.h:48:
In module 'ObjectiveC' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/os/object.h:75:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/usr/include/objc/NSObject.h:43:38: note: property declared here
@property (readonly, copy) NSString *description;
                                     ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:47:13: error: 'ACEDrawingPenTool' cannot use 'super' because it is a root class
    self = [super init];
            ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:49:14: error: property 'lineCapStyle' not found on object of type 'ACEDrawingPenTool *'
        self.lineCapStyle = kCGLineCapRound;
             ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:50:14: warning: incompatible pointer types assigning to 'CFMutableDataRef' (aka 'struct __CFData *') from 'CGMutablePathRef' (aka 'struct CGPath *') [-Wincompatible-pointer-types]
        path = CGPathCreateMutable();
             ^ ~~~~~~~~~~~~~~~~~~~~~
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:74:19: error: incompatible pointer types passing retainable parameter of type 'CFMutableDataRef' (aka 'struct __CFData *')to a CF function expecting 'CGMutablePathRef' (aka 'struct CGPath *') type
    CGPathAddPath(path, NULL, subpath);
                  ^~~~
In module 'CoreText' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:28:
In module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h:296:47: note: passing argument to parameter 'path1' here
CG_EXTERN void CGPathAddPath(CGMutablePathRef path1,
                                              ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:82:28: error: implicit declaration of function 'UIGraphicsGetCurrentContext' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    CGContextRef context = UIGraphicsGetCurrentContext();
                           ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:82:18: warning: incompatible integer to pointer conversion initializing 'CGContextRef' (aka 'struct CGContext *') with an expression of type 'int' [-Wint-conversion]
    CGContextRef context = UIGraphicsGetCurrentContext();
                 ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:84:28: error: incompatible pointer types passing retainable parameter of type 'CFMutableDataRef' (aka 'struct __CFData *')to a CF function expecting 'CGPathRef' (aka 'const struct CGPath *') type
        CGContextAddPath(context, path);
                                  ^~~~
In module 'CoreText' imported from /Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:28:
In module 'CoreGraphics' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:311:65: note: passing argument to parameter 'path' here
CG_EXTERN void CGContextAddPath(CGContextRef context, CGPathRef path)
                                                                ^
/Users/drdaz/Desktop/DrawingTest/DrawingTest/ACEDrawingView/ACEDrawingTools.m:87:61: error: member reference base type 'int *' is not a structure or union
    CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
                                              ~~~~~~~~~~~~~~^~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 warnings and 20 errors generated.</code>

Undo functionality takes time

Your code works perfectly for me. But when i draw so much data at that time undo function take exponential time depends on the content draw on the drawing pad. How can i reduce that time while undoing? I don't know how much time undo function take when it is called because it is dependent on total content.

Drawing slides when orientation changes

Hello there,

First of all, I'd like to thank you for developing and open sourcing this project. It has been immensely useful to us. There is one slight issue. After drawing lines and changing the orientation of the phone to landscape, the lines do rotate, but jump when a new line is added.
I've looked into it a bit but couldn't solve it. If anybody has any idea how I can solve this issue, please let me know.

Implementing 3D-Touch

I want to implement 3D-Touch and change the linewidth based on the pressure.
In the touchesMoved I use this code to change the lineWidth:

    CGFloat maximumPossibleForce = touch.maximumPossibleForce;
    CGFloat force = touch.force;
    CGFloat normalizedForce = force/maximumPossibleForce;
    CGFloat lineWidth = normalizedForce * 10;
    self.currentTool.lineWidth = lineWidth;

It works, however, when crossing lines with a previously drawn line, it overrides it.
If anyone knows a solution I would greatly appreciate it! Thanks :)

applyDrawToImage not present in cocoapods

- (UIImage *)applyDrawToImage:(UIImage *)baseImage;

is not present when integrating this library with cocoapods, maybe the library is not updated to the latest version?

disable drawTool

is there any way we could disable a drawTool or any state that will disabled all drawTool options. thanks!

how can i erase lines ?

i would like erase lines or other paint tool. i know that if i select the background color i can imitate erase, but i put image background this solution is not valid.

Support zooming

What would be the best approach to adding zooming functionality? Thanks!

Partial redraw...

Hi there (and happy holidays!)

I've noticed the TODO in ACEDrawingView, where you write that you need to implement partial redraw in the drawRect method. I'm in a situation where I am using this component to draw on top of full resolution (8MP) photos. The full redraw causes the component to lag and crash when the image is zoomed out fully (I've embedded the view in a UIScrollView). At least, I believe this is the cause of the crash - Apple's documentation suggests this is likely the case, but there is no stack trace or error to debug.

This is not a whine, but rather I'm interested in implementing the partial redraw logic. Unless I'm reading it wrong, you began the implementation since the pen tool requests a partial update, but the drawRect method ignores it.

I'm not that familiar with CoreGraphics, so if you have the time I'd like to hear how you thought to implement this functionality, rather than hacking at it from the ground up myself. From the time I've spent looking at the flow of the pen tool, my instinct tells me to get the draw method to return a UIImage and draw that image in the rect specified in the touches... call. I've made some modifications to that effect, but I'm not getting what I'm looking for.

So... yeah. If you've got a moment I'd love to have a dialogue about this. I'd be happy to contribute any usable code I create back to the project.

FPS Issue

Seems that there is some performance trouble with FPS. See attached image.
I am just continiuosly painting for 1 minute without stopping. FPS is extremelly falling down...

Have you got any solution for this issue?

ss

DraggableText issue

ACEDrawingView Version : 2.0.1

added some draggable texts into drawingview. But it would not appear in preview. Please see attach file.

simulator screen shot 18-oct-2016 6 09 40 pm
simulator screen shot 18-oct-2016 6 10 17 pm

Please could you do fix it.

ACEDraggableText.bundle not found?

I update to the last version and here is what I got:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001067c834b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010a1e321e objc_exception_throw + 48
    2   CoreFoundation                      0x0000000106831265 +[NSException raise:format:] + 197
    3   Foundation                          0x0000000109cd6b3d -[NSBundle initWithURL:] + 87
    4   Foundation                          0x0000000109cd6ad3 +[NSBundle bundleWithURL:] + 45
    5   ACEDrawingView                      0x0000000105482f6f -[ACEDrawingView configure] + 703
    6   ACEDrawingView                      0x0000000105482c6a -[ACEDrawingView initWithCoder:] + 138

The ACEDrawingView is instantiated from a Storyboard.

Cocoapod: 1.0.1
Xcode: 8.0

ACEDrawingToolTypeCustom enum causes crash in demo app

ACEDrawingToolTypeCustom was added to the top of the ACEDrawingToolType enum essentially making it the default value for drawTool. This leads to a crash since customDrawTool has not been specified.

The fix is to either move ACEDrawingToolTypeCustom out of the zero position in the enum or to explicitly default drawTool to ACEDrawingToolTypePen in configure().

Question about updating image cache

Hi.

Thanks for this amazing project. I have one question.

We have an image on our canvas. So, all paths should be added to it's context.
When we move our finger by screen - we see line (new paths added through draw cycles).
But there is only one place, where image grabs the context info:

  • (void)updateCacheImage:(BOOL)redraw

function. It called only when touches end.
Why we can see line during drawing (instead blank screen and appearing this curve after finishing touch)?

Curves are not smooth

Hello, firstly I want to thank you for this great project. Secondly, I want to mention that, the curves are not very smooth, you will notice it when you try to write very closely. Can you suggest how it can be tweaked, so that we get bamboo like smooth curves while writing.

I am attaching the images for reference , how it looks on bamboo and your app.

img_0088
img_0089

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.