Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By Shadowriver
  1. Thread Author  Thread Author    #1  

    Default Can I resize and drag-drop the rectangle on the canvas by the finger touch event in android?

    I want the develope such type of applicattion by which I can open an image(jpg/png) on the andoid canvas and make a markup on it with the text like a rectangle, an arrow and after that I want to save that image on the storage media with these changes. I use all the basice function of the cavas class.
    plese help..............
    -Thanks In Advance
    Thank you.
    Rahul Rana
  2. #2  

    Default Re: Can I resize and drag-drop the rectangle on the canvas by the finger touch event in android?

    I don't think there ready object in Android to do draw and manipulate something on canvas, personally i didn't play with it on Android yet so i'm not 100% sure, but this is how most canvases work... you need to draw everything for yourself

    I kind of not understand what you want to make, but im most common scenerios if oyu want to do something editable on canvas you need some array of your objects to draw and some function that will draw those object on canvas. Then do attach touch events (each android layout object can have OnTouch events binded) to canvas that will check what object is under your touch (check array of object in order from top to bottom and check if positions are matched) and then chage postion of object depending how finger moves. You will have to redraw canvas in each update made to object that will change, to reduce process keep bitmap off current content of canvas except object that being edited and draw updated object on top of it on each touch even that change something, if you have anything above layer with object you edit you will need extra bitmap for stuff that is above and draw it after updated object is draw. So i recommended you to create whole rendering class that will handle all of this that you can attach to any canvas on layout

    I hope i understand you right and that this will help you out ;] Also Google Android Developer if you looking which function to use etc. i assume you know the basics

    Also i think you post this in wrong section
    Thanked by:
  3. #3  

    Default Re: Can I resize and drag-drop the rectangle on the canvas by the finger touch event in android?

    Oh sorry you could actually create child of Canvas class and make it placable and working on layout without need of attaching, read how to make custom controls
    Thanked by:
    Rahul Rana likes this.
  4. Thread Author  Thread Author    #4  

    Default Re: Can I resize and drag-drop the rectangle on the canvas by the finger touch event in android?

    Thanx Shadowriver ..............
    I try to explain what i want to do..................
    I want to make an app in android by which user open an image on the canvas and set on the image markers like (rect, ovel etc) with the text and after that save the image with that changes so, I want to give the control of the markers to the user so that he/she can drag-drop and re-size the markers and after that image saved with these changes.
    can I do this with the canvas or not? if yes then please give me idea how, or if not then you can suggest other approach............

    Thank you.
    Last edited by Rahul Rana; 12-05-2012 at 01:51 AM.
    Thank you.
    Rahul Rana
  5. #5  

    Default Re: Can I resize and drag-drop the rectangle on the canvas by the finger touch event in android?

    Well you can do that with canvas if you want but you would need to do everything for yourself and i already writed idea how, but you could also try to use android layout system, place text on image view and try to capture part of the screen where is the image, it would be easier this way
    Thanked by:

Similar Threads

  1. Can't charge and use kickstand at the same time?
    By zero neck in forum Verizon HTC Thunderbolt
    Replies: 72
    Last Post: 01-31-2011, 09:58 AM
  2. Replies: 32
    Last Post: 01-11-2011, 09:50 AM
  3. Installed ApeX RC2 over the weekend, now Chrome2Phone and Awesome Drop don't work.
    By PsychicRefugee in forum Motorola X Rooting, ROMs, and Hacks
    Replies: 3
    Last Post: 11-21-2010, 08:21 PM
  4. 5. Now you can go ahead and install the Stock Froyo rom.
    By Angmoe in forum Incredible Rooting, ROMs, and Hacks
    Replies: 10
    Last Post: 07-29-2010, 09:04 PM
  5. Replies: 4
    Last Post: 05-14-2010, 12:22 PM

Posting Permissions

B