Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, you can do this in Titanium. A naive implementation is below, drafted and tested in 5 minutes.</p> <p>To give you an idea what it could look like, refer to the following. Then look at TiDraggable, by Pedro Enrique, if you want to enhance it to let the user drag around text or images relative to each other: <a href="https://github.com/pec1985/TiDraggable" rel="nofollow">https://github.com/pec1985/TiDraggable</a></p> <pre><code>// This app consists of two visual parts: a canvas where the user does stuff, // and a save button in the bottom right. var win = Ti.UI.createWindow({ backgroundColor: 'black' }); // First, the canvas. var canvas = Ti.UI.createView({ bottom: 50, backgroundColor: 'white' }); // It has a scroll view so the user can... var scroll = Ti.UI.createScrollView({ // ... zoom content in or out. maxZoomScale: 2, minZoomScale: 0.1, // .. and freely position the image. contentWidth: 1000, contentHeight: 1000 }); // Add the image to the middle of the scroll view. scroll.add(Ti.UI.createImageView({ image: 'http://appc.me/Content/kitten.jpg', width: 750, height: 426, hires: true })); canvas.add(scroll); // Add some text. canvas.add(Ti.UI.createLabel({ text: 'Kittens are the best.', textAlign: 'center', font: { fontSize: 28 }, color: '#000', bottom: 20 })); // Add the canvas to the win. win.add(canvas); // Second, create the "save" button. var save = Ti.UI.createButton({ title: 'Save to Gallery', height: 30, width: Ti.UI.SIZE, bottom: 10, right: 10 }); save.addEventListener('click', function (evt) { // Turn our "canvas" view (and its children) in to an image, // and save it to the gallery. Ti.Media.saveToPhotoGallery(canvas.toImage(), { success: function () { alert('Saved!'); }, error: function () { alert('Oh no...'); } }); }); // Add it to the win. win.add(save); win.open(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload