Git Product home page Git Product logo

ioscolorpad's Introduction

iOSHelloWorld

In this tutorial, you will create a vector drawing app based on TouchVG. See touchvg/Readme.txt to copy files required to compile.

  • Create a project with the Single View Application wizard.

  • Add the libraries and header files of TouchVG to this project.

    • `cd' to the 'ios' directory of the TouchVG project.
    • Type ./build.sh to compile libraries outputed to the 'ios/output' directory.
    • Add TouchVG, TouchVGCore, libTouchVG.a and libTouchVGCore.a to this project.
    • Change 'Library Search Paths' of the HelloWorld target from '.../iOSHelloWorld/touchvg' to the relative path 'touchvg'.
  • Add QuartzCore.framework and libc++.dylib in 'Link Binary With Libraries' of the target.

    • Add libc++.dylib for ViewController.m or change ViewController.m to ViewController.mm to use Obj-C++ classes of TouchVG.
  • Add a vector drawing view in ViewController.mm/.m:

    • Add #import "GiViewHelper.h" to use helper = [GiViewHelper sharedInstance].
    • Add a drawing view in self.view via [helper createGraphView:self.view.bounds :self.view];.
    • Start the free-hand splines command via helper.command = @"splines";. The names of all commands will be printed in logging after the app runs.
  • Enjoy the simple drawing app now! You can fork this project and add drawing UI reference to ColorPad wizard.

How to Build

  • Type ./build.sh to compile libraries and copy them to touchvg directory.
  • Or type ./build.sh -arch arm64 to make for iOS 64-bit.
  • Then run HelloWorld.xcodeproj in Xcode.

Contributors

ioscolorpad's People

Contributors

ljlin avatar rhcad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ioscolorpad's Issues

如何修改笔刷粗细?

给GiviewHelper实例的lineWith属性赋值似乎并不管用。

是因为启动命令splines的缘故吗?

想要在手机翻转时重新设置GiPaintView大小

我是这样做的
step1:首先在storyboard中对mainMage和ButtonView两个UIView使用AutoLayout进行了设置。
step2:mainMage只有一个subView就是在ViewController的ViewDIdLoad函数中创建的一个GiPaintView。
step3:添加如下代码

  • (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
    self.mPaintView.frame = self.mainMage.frame;
    }

会出现未绘制完成的图元在绘制完成后突然蹦到另一个位置,如果绘制已经绘制完成图元和未完成图元是在touchvg中使用了两个UIView建议提供API或者在对应frame的setter中同步设置两者。我也对阅读touchvg感兴趣,仍在阅读中。

如何使用redo&undo功能?

遇到的困难有
1.调用startUndorecord log提示Fail to record shapes due to no front doc
2.如何使用redo&undo,是否直接调用 GiViewHelper的 redo undo函数

关于GiViewHelper setCommand函数参数

  • (BOOL)setCommand:(NSString *)name withParam:(NSString *)param; //!< 指定名称和JSON串参数,启动命令

是否有这个函数接受参数及其含义的列表

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.