KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
** THIS QUESTION WAS SUCCESSFULLY ANSWERED AND HAS BECOME A BLOG POST <- click ** Hi I am a PHP developer I want to do a simple thing - I want to draw something drawn on a blank page on an Android Phone (with a finger with a largeish "emulated pen nib") and store the bitmap as a jpeg on a server by http post. Here is what I have so far but this is taken from a tutorial that is involved with writing sprites for a game.. And I cant' adapt it package com.my.example; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.os.Bundle; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.View.OnTouchListener; public class DrawCapture extends Activity implements OnTouchListener{ OurView v; Bitmap ball; float x,y; @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.draw_capture); v = new OurView(this); v.setOnTouchListener(this); ball = BitmapFactory.decodeResource(getResources(), R.drawable.blueball); x = y = 0; setContentView(v); } @Override protected void onPause(){ super.onPause(); v.pause(); } protected void onResume(){ super.onResume(); v.resume(); } public class OurView extends SurfaceView implements Runnable{ Thread t = null; SurfaceHolder holder; boolean isItOK = false; public OurView(Context context) { super(context); holder =
Tags (comma-separated)
Save Edits
Cancel