6

hi
Here's what i want to do.
- Open a jpg in full screen.
- Type text on the jpg.
- able to move that text where i want it positioned on the bitmap.
- moving of text must be done with a finger (not in code).

kind of like creating a personal funny Christmas card...

I find loots of example of writing text onto Bitmap but nothing about moving that text around.

Help is needed!

EDIT - The image and added text must be saved as a new jpg with same size

Erik
  • 5,039
  • 10
  • 63
  • 119

1 Answers1

5
  1. Draw the bitmap onto the screen, then draw the text onto it at an initial x,y (e.g. the center), following the examples you found.

  2. Receive input events describing finger-dragging movements.

  3. Use those input events to change the x,y values for drawing the text.

  4. Redraw the bitmap and the text onto the screen, with the text being at the new x,y location.

  5. Repeat from step 2.

Let us know if there are particular parts of this that you need more elaboration on.

LarsH
  • 27,481
  • 8
  • 94
  • 152
  • Im using this example as a startingpoint: .........http://www.anddev.org/viewtopic.php?p=11603... It's tree balls that user can drag around the screen. the app has tree classes ball class, extends activity and extends ImageView. Im playing around with the ide to replace the ball class with some kind of positioning engine for the (movable – Erik May 08 '11 at 18:16
  • (movable-text). The Problem is that when user is "done". The text and image must be merge together to form a new picture i cannot figure out how to do that – Erik May 08 '11 at 18:23
  • @Erik: this question/answer may help you: http://stackoverflow.com/questions/2996759/android-source-code-not-working-reading-frame-buffer-through-glreadpixels – LarsH May 09 '11 at 19:48
  • Thanks but it did not help. Im stumbling forward anyway and managed – Erik May 10 '11 at 20:09
  • @LarsH I finally followed your step-by-step and the [Answer workes](http://stackoverflow.com/questions/6023549/android-how-to-get-the-image-edge-x-y-position-inside-imageview) – Erik May 16 '11 at 21:23
  • @Erik: Good! Glad you figured it out. – LarsH May 16 '11 at 21:41