Giter VIP home page Giter VIP logo

ti.paint's Introduction

ti.paint

This is the Paint Module for Titanium.

Usage

var Paint = require('ti.paint');
var paintView = Paint.createPaintView({});

Functions

  • clear() Clears the paint view.

  • moveTo(x,y) [Android only] Move to position x/y

  • lineTo(x,y) [Android only] Draw line to position x/y

  • enable(true/false) [Android only] Disable drawing

  • undo()/redo() [Android only] Undo or redo last action

Properties

  • strokeWidth[double] Controls the width of the strokes.

  • strokeColor[string] Controls the color of the strokes.

  • strokeAlpha[int] Controls the opacity of the strokes.

  • eraseMode[boolean] Controls if the strokes are in "erase mode" -- that is, any existing paint will be erased.

  • image[string] Loads an image (by its URL) directly in to the paint view so that it can be drawn on and erased.

Events

  • touchcancel Fired when a touch event is interrupted by the device.

  • touchend Fired when a touch event is completed.

  • touchmove Fired as soon as the device detects movement of a touch.

  • touchstart Fired as soon as the device detects a touch gesture.

Contributors

Legal

This module is Copyright (c) 2010-present by Tidev, Inc. All Rights Reserved. Usage of this module is subject to the Terms of Service agreement with Tidev, Inc.
nc.

ti.paint's People

Contributors

ashcoding avatar caspahouzer avatar cauld avatar cb1kenobi avatar dawsontoth avatar ewanharris avatar garymathews avatar hansemannn avatar hazemkhaled avatar infosia avatar ingo avatar jeffenglish avatar jonalter avatar m1ga avatar muhammaddadu avatar saeed1989 avatar stephenfeather 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

Watchers

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

ti.paint's Issues

Couldn't set strokeWidth in Android lollipop

Hi, I am struck with this issue for couple of days. Please help me with the following code:

var paintView = Paint.createPaintView({
image : icons.chartBoardBg,
strokeColor : '#0f0',
strokeAlpha : 255,
strokeWidth : 10,
eraseMode : false
});
win.add(paintView);

var buttonStrokeWidth = Ti.UI.createButton({
left : 10,
bottom : 10,
right : 10,
height : 50,
title : 'Increase Stroke Width'
});

buttonStrokeWidth.addEventListener('click', function(e) {
    paintView.strokeWidth = 50;
});
win.add(buttonStrokeWidth);

After the button click I am trying to increase the strokeWidth of the paintView. But its not working and user is unable to draw.

Can't run on Android 6.0

Can't run on Android 6.0 with SDK 5.1 because of text relocations.
This is the 64Bit problem with IOS modules all over again... the SDK is upgraded but the modules is not..
This renders SDK 5.1 GA useless if You use this module...
Sorry for the language, but this is frustrating...

Not Able to Deploy and Run in iPA file.

HI Team,

I am not able to incorporate the module in Appcelerator iOS Project. When I incorporate and generate an iPA my iPA doesnt work .

I have referenced the module as instructed. My Screen doesnt goes from List Screen to detail screen. I have referenced the module in the detail page of the project.

1.4 and 1.4.1 still not working on iOS iPad Air

I have an app I inherited that uses ti.paint 1.1
When I upgrade to 1.4 (and even tried 1.4.1), the app opens on 64-bit, but the drawing and text addition features do not work at all.
It just draws a black line when I tap and drag with any of the tools.... but the line disappears completely on touch end.

Any thoughts?
Should I try to recompile the 1.1 version for 64 bit? the 1.1 version still works on 32-bit... but the 1.4 version does NOT work on 32-bit.

Crash when calling setStrokeWidth() while touch events are being processed

setStrokeWidth (and color/mode/alpha and also setImage) are called on the kroll runtime thread. All these lead to UIPaintView.finalizePaths() which nullifies tiPaths. If this happens while touch events are being processed (on the UI thread), you'd get a null reference in finalizePath() (without s).

The solution is to either execute all the public interface on the UI thread (same as clear is implemented), or synchronize on tiPath and possibly other members.

How to install this as a module

I stumbled here upon clicking the Download button from the Appcelerator marketplace. Normally, it should take me to the products page and allow me to download this as a zip file ready to be installed as a module. Can anyone give directions on how to compile this repo to that same zip file? Thanks

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.