Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>public class TouchView extends View{ private File tempFile; private byte[] imageArray; private Bitmap bgr; private Bitmap bm; private Bitmap bgr2 = null;; private Paint pTouch; private int centreX = 1; private int centreY = 1; private int radius = 50; private int Progress = 1; private static final String TAG = "*********TouchView"; private Filters f = null; public TouchView(Context context) { super(context); // TouchView(context, null); } public TouchView(Context context, AttributeSet attr) { super(context,attr); //code to get image from camera and sdcard bgr2 = Bitmap.createBitmap(bm.getWidth(), bm.getHeight(), bm.getConfig()); f = new Filters(); }// end of touchView constructor public void findCirclePixels(){ float prog = (float)Progress/150000; bgr2 = f.barrel(bgr,prog); }// end of changePixel() public void initSlider(final HorizontalSlider slider) { Log.e(TAG, "******setting up slider*********** "); slider.setOnProgressChangeListener(changeListener); } private OnProgressChangeListener changeListener = new OnProgressChangeListener() { @Override public void onProgressChanged(View v, int progress) { // TODO Auto-generated method stub setProgress(progress); Log.e(TAG, "***********progress = "+Progress); } }; private class MyTask extends AsyncTask&lt;Void, Void, Void&gt; { protected void onPreExecute() { } @Override protected Void doInBackground(Void... params) { TouchView.this.findCirclePixels(); } protected void onPostExecute(Void result) { TouchView.this.invalidate(); } } @Override public void onDraw(Canvas canvas){ super.onDraw(canvas); canvas.drawBitmap(bgr2, 0, 0, null); }//end of onDraw protected void setProgress(int progress2) { this.Progress = progress2; new MyTask.execute(); } } </code></pre>
 

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