Git Product home page Git Product logo

Comments (5)

vtourraine avatar vtourraine commented on August 17, 2024 1

We would need to have all the drawing tools adhere to the NSCoding protocol. UIBezierPath already supports it, but we also need to (de)code the colors, line size, etc.

If someone feels like sending a pull-request, that would be useful.

from acedrawingview.

vipinjohney avatar vipinjohney commented on August 17, 2024 1

Just adding how I did this, incase some one is in need.

  1. Make the following code public in ACEDrawingView.h
@property (nonatomic, strong) NSMutableArray *pathArray;
@property (nonatomic, strong) NSMutableArray *bufferArray;

- (void)updateCacheImage:(BOOL)redraw;
  1. Save pathArray and bufferArray from the previous instance of ACEDrawingView.
  2. When a new ACEDrawingView (let it be 'drawView') is created provide it with the values from previously saved pathArray and bufferArray.
  3. Over ride layoutSubviews() in parent view and call the method drawView.updateCacheImage(True)

Note: drawView.updateCacheImage(True) will work only when its called before the view is displayed. I found that calling this method after view is loaded, some how makes the drawings hidden and appears when we draw over it again.

Disclaimer: Not tested properly. Will add the issues after I finish testing.

from acedrawingview.

wangsuikang avatar wangsuikang commented on August 17, 2024

Hi,vipinjohney
I also want to save the drawing and open it again.do you finish testing ? thanks.

from acedrawingview.

SidduIOS avatar SidduIOS commented on August 17, 2024

Hi vipinjohney

I need to update previous draw lines with selected pattern image.could you help me in this issue.
I did what you said above redrawing is working perfectly but those line were not update.

from acedrawingview.

vipinjohney avatar vipinjohney commented on August 17, 2024

Above solutions by me had many issues. One of them was, each time I redraw the saved lines and draw a new line the previous set of lines changed their location. Tried to fix that but dropped it due to lack of time .

from acedrawingview.

Related Issues (20)

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.