android Programming Glossary: c.drawcolor
Android Paint PorterDuff.Mode.CLEAR http://stackoverflow.com/questions/10494442/android-paint-porterduff-mode-clear mBitmap Canvas c new Canvas saveBitmap c.drawColor 0xFFFFFFFF c.drawBitmap mBitmap 0 0 null saveBitmap.compress..
Android ICS and MJPEG using AsyncTask http://stackoverflow.com/questions/10550139/android-ics-and-mjpeg-using-asynctask destRect destRect bm.getWidth bm.getHeight c.drawColor Color.BLACK c.drawBitmap bm null destRect p if showFps ..
Punch a hole in a rectangle overlay with HW acceleration enabled on View http://stackoverflow.com/questions/13528550/punch-a-hole-in-a-rectangle-overlay-with-hw-acceleration-enabled-on-view final Canvas c new Canvas b Draw the rectangle colour. c.drawColor backColor Erase a circle. c.drawCircle cx cy radius eraser Draw.. c new Canvas b b.eraseColor Color.TRANSPARENT c.drawColor backColor c.drawCircle cx cy radius eraser canvas.drawBitmap.. needed if backColor is not opaque thanks @JosephEarl c.drawColor backColor c.drawCircle cx cy radius eraser canvas.drawBitmap..
Android and MJPEG http://stackoverflow.com/questions/3205191/android-and-mjpeg destRect destRect bm.getWidth bm.getHeight c.drawColor Color.BLACK c.drawBitmap bm null destRect p if showFps ..
Clearing canvas with Canvas.drawColor() http://stackoverflow.com/questions/4650755/clearing-canvas-with-canvas-drawcolor persists. i've tried drawColor 0 drawColor Color.BLACK c.drawColor 0 PorterDuff.Mode.CLEAR and none of the above works. as such.. Bitmap b BitmapFactory.decodeResource getResources bgnd c.drawColor 0 PorterDuff.Mode.CLEAR c.drawBitmap b 0 0 null switching false..
How to crop image in android http://stackoverflow.com/questions/6464123/how-to-crop-image-in-android 2F Path.Direction.CW c.clipPath p Region.Op.DIFFERENCE c.drawColor 0x00000000 PorterDuff.Mode.CLEAR If the output is required to..
Android Paint PorterDuff.Mode.CLEAR http://stackoverflow.com/questions/10494442/android-paint-porterduff-mode-clear try fos new FileOutputStream file Bitmap saveBitmap Bitmap.createBitmap mBitmap Canvas c new Canvas saveBitmap c.drawColor 0xFFFFFFFF c.drawBitmap mBitmap 0 0 null saveBitmap.compress Bitmap.CompressFormat.PNG 100 fos saveBitmap.recycle .....
Android ICS and MJPEG using AsyncTask http://stackoverflow.com/questions/10550139/android-ics-and-mjpeg-using-asynctask synchronized mSurfaceHolder try bm mIn.readMjpegFrame destRect destRect bm.getWidth bm.getHeight c.drawColor Color.BLACK c.drawBitmap bm null destRect p if showFps p.setXfermode mode if ovl null height ovlPos 1 1 destRect.top..
Punch a hole in a rectangle overlay with HW acceleration enabled on View http://stackoverflow.com/questions/13528550/punch-a-hole-in-a-rectangle-overlay-with-hw-acceleration-enabled-on-view Bitmap.createBitmap getWidth getHeight Bitmap.Config.ARGB_8888 final Canvas c new Canvas b Draw the rectangle colour. c.drawColor backColor Erase a circle. c.drawCircle cx cy radius eraser Draw the bitmap on our views canvas. canvas.drawBitmap b 0 0.. null b Bitmap.createBitmap getWidth getHeight Bitmap.Config.ARGB_8888 c new Canvas b b.eraseColor Color.TRANSPARENT c.drawColor backColor c.drawCircle cx cy radius eraser canvas.drawBitmap b 0 0 null The performance is not as good as method 3 but much..
Android and MJPEG http://stackoverflow.com/questions/3205191/android-and-mjpeg synchronized mSurfaceHolder try bm mIn.readMjpegFrame destRect destRect bm.getWidth bm.getHeight c.drawColor Color.BLACK c.drawBitmap bm null destRect p if showFps p.setXfermode mode if ovl null height ovlPos 1 1 destRect.top..
Clearing canvas with Canvas.drawColor() http://stackoverflow.com/questions/4650755/clearing-canvas-with-canvas-drawcolor Canvas.drawColor before drawing the new image but the old image persists. i've tried drawColor 0 drawColor Color.BLACK c.drawColor 0 PorterDuff.Mode.CLEAR and none of the above works. as such i had to post this for review from more experienced minds than.. break protected void onDraw Canvas c if switching true Bitmap b BitmapFactory.decodeResource getResources bgnd c.drawColor 0 PorterDuff.Mode.CLEAR c.drawBitmap b 0 0 null switching false else Bitmap b BitmapFactory.decodeResource getResources..
How to crop image in android http://stackoverflow.com/questions/6464123/how-to-crop-image-in-android Path p new Path p.addCircle width 2F height 2F width 2F Path.Direction.CW c.clipPath p Region.Op.DIFFERENCE c.drawColor 0x00000000 PorterDuff.Mode.CLEAR If the output is required to a specific size then scale or fill if mOutputX 0 mOutputY..
|