¡@

Home 

2014/10/16 ¤W¤È 08:18:56

android Programming Glossary: mcanvas

Android FingerPaint Undo/Redo implementation

http://stackoverflow.com/questions/10165965/android-fingerpaint-undo-redo-implementation

mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mCanvas.drawColor Color.WHITE @Override protected.. w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mCanvas.drawColor Color.WHITE @Override protected void onDraw Canvas.. mPath.lineTo mX mY commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset..

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

http://stackoverflow.com/questions/10482229/draw-rectangle-over-imageview-for-highlight-that-can-be-zoom-in-out-in-android

x2 0 y1 0 y2 0 Log.v Log_tag ImageBitmap is draw Canvas mCanvas new Canvas bitmap mCanvas.drawRect x1 y1 x2 y2 mPaint canvas.clipRect.. ImageBitmap is draw Canvas mCanvas new Canvas bitmap mCanvas.drawRect x1 y1 x2 y2 mPaint canvas.clipRect left top right.. PRESET_PRESSURE pressure 8 int PRESET_PRESSURE pressure mCanvas.drawCircle x1 y1 PRESET_SIZE size paint canvas.save canvas.translate..

Android Canvas Redo and Undo Operation

http://stackoverflow.com/questions/11114625/android-canvas-redo-and-undo-operation

extends View implements OnTouchListener private Canvas mCanvas private Path mPath private Paint mPaint private ArrayList Path.. Paint.Cap.ROUND mPaint.setStrokeWidth 6 mCanvas new Canvas mPath new Path paths.add mPath im BitmapFactory.decodeResource.. mPath.lineTo mX mY commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath..

Masking(crop) image in frame

http://stackoverflow.com/questions/12614542/maskingcrop-image-in-frame

mask.getWidth mask.getHeight Config.ARGB_8888 Canvas mCanvas new Canvas result Paint paint new Paint Paint.ANTI_ALIAS_FLAG.. new PorterDuffXfermode PorterDuff.Mode.DST_IN mCanvas.drawBitmap original 0 0 null mCanvas.drawBitmap mask 0 0 paint.. mCanvas.drawBitmap original 0 0 null mCanvas.drawBitmap mask 0 0 paint paint.setXfermode null mImageView.setImageBitmap..

Crop image by polygon area

http://stackoverflow.com/questions/15969028/crop-image-by-polygon-area

obmp.getHeight Bitmap.Config.ARGB_8888 Canvas mCanvas new Canvas resultImg Canvas maskCanvas new Canvas maskImg Paint.. view.x4 view.y4 path.close maskCanvas.drawPath path paint mCanvas.drawBitmap obmp 0 0 null mCanvas.drawBitmap maskImg 0 0 paint.. path paint mCanvas.drawBitmap obmp 0 0 null mCanvas.drawBitmap maskImg 0 0 paint android image image processing..

Android color picker to be included in the activity

http://stackoverflow.com/questions/16363235/android-color-picker-to-be-included-in-the-activity

float MAXP 0.75f private Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint Context context.. mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap @Override protected void onDraw Canvas canvas.. mX mY circlePath.reset commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset..

Draw in Canvas by finger android

http://stackoverflow.com/questions/16650419/draw-in-canvas-by-finger-android

public int height private Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint Context context.. mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap @Override protected void onDraw Canvas canvas.. mX mY circlePath.reset commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset..

Save the image made by user in fingerPaint api demos in android

http://stackoverflow.com/questions/5029775/save-the-image-made-by-user-in-fingerpaint-api-demos-in-android

MAXP 0.75f private static Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint public fingerPaint.. Bitmap.createBitmap 320 480 Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mPath new Path mBitmapPaint new Paint Paint.DITHER_FLAG.. Bitmap.createBitmap 320 480 Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mPath new Path mBitmapPaint new Paint Paint.DITHER_FLAG..

Android FingerPaint Undo/Redo implementation

http://stackoverflow.com/questions/10165965/android-fingerpaint-undo-redo-implementation

w int h int oldw int oldh super.onSizeChanged w h oldw oldh mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mCanvas.drawColor Color.WHITE @Override protected void onDraw Canvas canvas canvas.drawColor Color.WHITE.. super.onSizeChanged w h oldw oldh mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mCanvas.drawColor Color.WHITE @Override protected void onDraw Canvas canvas canvas.drawColor Color.WHITE canvas.drawBitmap mBitmap.. mPath.quadTo mX mY x mX 2 y mY 2 mX x mY y private void touch_up mPath.lineTo mX mY commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset @Override public boolean onTouchEvent MotionEvent event..

Draw Rectangle Over ImageView for highlight that can be zoom in-out in android

http://stackoverflow.com/questions/10482229/draw-rectangle-over-imageview-for-highlight-that-can-be-zoom-in-out-in-android

100 100 Bitmap.Config.RGB_565 if bitmap null if x1 0 x2 0 y1 0 y2 0 Log.v Log_tag ImageBitmap is draw Canvas mCanvas new Canvas bitmap mCanvas.drawRect x1 y1 x2 y2 mPaint canvas.clipRect left top right bottom paint.setStyle Paint.Style.FILL_AND_STROKE.. if bitmap null if x1 0 x2 0 y1 0 y2 0 Log.v Log_tag ImageBitmap is draw Canvas mCanvas new Canvas bitmap mCanvas.drawRect x1 y1 x2 y2 mPaint canvas.clipRect left top right bottom paint.setStyle Paint.Style.FILL_AND_STROKE paint.setStrokeWidth.. 0xFF000000 int PRESET_PRESSURE pressure 16 int PRESET_PRESSURE pressure 8 int PRESET_PRESSURE pressure mCanvas.drawCircle x1 y1 PRESET_SIZE size paint canvas.save canvas.translate mPosX mPosY canvas.scale mScaleFactor mScaleFactor..

Android Canvas Redo and Undo Operation

http://stackoverflow.com/questions/11114625/android-canvas-redo-and-undo-operation

import android.view.View.OnTouchListener public class DrawView extends View implements OnTouchListener private Canvas mCanvas private Path mPath private Paint mPaint private ArrayList Path paths new ArrayList Path private ArrayList Path undonePaths.. Paint.Style.STROKE mPaint.setStrokeJoin Paint.Join.ROUND mPaint.setStrokeCap Paint.Cap.ROUND mPaint.setStrokeWidth 6 mCanvas new Canvas mPath new Path paths.add mPath im BitmapFactory.decodeResource context.getResources R.drawable.ic_launcher .. mX mY x mX 2 y mY 2 mX x mY y private void touch_up mPath.lineTo mX mY commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath new Path paths.add mPath public void onClickUndo if paths.size..

Masking(crop) image in frame

http://stackoverflow.com/questions/12614542/maskingcrop-image-in-frame

getResources R.drawable.mask Bitmap result Bitmap.createBitmap mask.getWidth mask.getHeight Config.ARGB_8888 Canvas mCanvas new Canvas result Paint paint new Paint Paint.ANTI_ALIAS_FLAG paint.setXfermode new PorterDuffXfermode PorterDuff.Mode.DST_IN.. result Paint paint new Paint Paint.ANTI_ALIAS_FLAG paint.setXfermode new PorterDuffXfermode PorterDuff.Mode.DST_IN mCanvas.drawBitmap original 0 0 null mCanvas.drawBitmap mask 0 0 paint paint.setXfermode null mImageView.setImageBitmap result mImageView.setScaleType.. paint.setXfermode new PorterDuffXfermode PorterDuff.Mode.DST_IN mCanvas.drawBitmap original 0 0 null mCanvas.drawBitmap mask 0 0 paint paint.setXfermode null mImageView.setImageBitmap result mImageView.setScaleType ScaleType.CENTER..

Crop image by polygon area

http://stackoverflow.com/questions/15969028/crop-image-by-polygon-area

Bitmap.Config.ARGB_8888 Bitmap maskImg Bitmap.createBitmap obmp.getWidth obmp.getHeight Bitmap.Config.ARGB_8888 Canvas mCanvas new Canvas resultImg Canvas maskCanvas new Canvas maskImg Paint paint new Paint Paint.ANTI_ALIAS_FLAG paint.setAntiAlias.. view.x2 view.y2 path.lineTo view.x3 view.y3 path.lineTo view.x4 view.y4 path.close maskCanvas.drawPath path paint mCanvas.drawBitmap obmp 0 0 null mCanvas.drawBitmap maskImg 0 0 paint android image image processing crop share improve this.. view.x3 view.y3 path.lineTo view.x4 view.y4 path.close maskCanvas.drawPath path paint mCanvas.drawBitmap obmp 0 0 null mCanvas.drawBitmap maskImg 0 0 paint android image image processing crop share improve this question Thanks for Eddy_Em i have..

Android color picker to be included in the activity

http://stackoverflow.com/questions/16363235/android-color-picker-to-be-included-in-the-activity

View private static final float MINP 0.25f private static final float MAXP 0.75f private Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint Context context private Paint circlePaint private Path circlePath public DrawingView.. w int h int oldw int oldh super.onSizeChanged w h oldw oldh mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap @Override protected void onDraw Canvas canvas super.onDraw canvas canvas.drawBitmap mBitmap 0 0 mBitmapPaint.. invalidate private void touch_up mPath.lineTo mX mY circlePath.reset commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset @Override public boolean onTouchEvent MotionEvent event..

Draw in Canvas by finger android

http://stackoverflow.com/questions/16650419/draw-in-canvas-by-finger-android

12 public class DrawingView extends View public int width public int height private Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint Context context private Paint circlePaint private Path circlePath public DrawingView.. w int h int oldw int oldh super.onSizeChanged w h oldw oldh mBitmap Bitmap.createBitmap w h Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap @Override protected void onDraw Canvas canvas super.onDraw canvas canvas.drawBitmap mBitmap 0 0 mBitmapPaint.. mY 30 Path.Direction.CW private void touch_up mPath.lineTo mX mY circlePath.reset commit the path to our offscreen mCanvas.drawPath mPath mPaint kill this so we don't double draw mPath.reset @Override public boolean onTouchEvent MotionEvent event..

Save the image made by user in fingerPaint api demos in android

http://stackoverflow.com/questions/5029775/save-the-image-made-by-user-in-fingerpaint-api-demos-in-android

static final float MINP 0.25f private static final float MAXP 0.75f private static Bitmap mBitmap private Canvas mCanvas private Path mPath private Paint mBitmapPaint public fingerPaint Context c super c mPaint new Paint mPaint.setAntiAlias.. Paint.Cap.ROUND mPaint.setStrokeWidth 12 mBitmap Bitmap.createBitmap 320 480 Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mPath new Path mBitmapPaint new Paint Paint.DITHER_FLAG public fingerPaint Context c AttributeSet attrs.. Paint.Cap.ROUND mPaint.setStrokeWidth 12 mBitmap Bitmap.createBitmap 320 480 Bitmap.Config.ARGB_8888 mCanvas new Canvas mBitmap mPath new Path mBitmapPaint new Paint Paint.DITHER_FLAG public void onerase mCanvas null @Override protected..