Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to circular a bitmap android

public Bitmap getCroppedBitmap(Bitmap bitmap) {
    Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
            bitmap.getHeight(), Config.ARGB_8888);
    Canvas canvas = new Canvas(output);

    final int color = 0xff424242;
    final Paint paint = new Paint();
    final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());

    paint.setAntiAlias(true);
    canvas.drawARGB(0, 0, 0, 0);
    paint.setColor(color);
    // canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
    canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2,
            bitmap.getWidth() / 2, paint);
    paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
    canvas.drawBitmap(bitmap, rect, rect, paint);
    //Bitmap _bmp = Bitmap.createScaledBitmap(output, 60, 60, false);
    //return _bmp;
    return output;
}
Comment

PREVIOUS NEXT
Code Example
Java :: empty character in java 
Java :: how to make javafx full screen default 
Java :: remove double quote java 
Java :: javafx tableview remove all rows 
Java :: java byte array to string 
Java :: Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer 
Java :: java selenium new window 
Java :: transparent dialog in android 
Java :: float to string java 
Java :: spigot spawn entity 
Java :: android start service on boot 
Java :: array to map java 
Java :: from string to int android studio 
Java :: apk full form 
Java :: spring load config value in variable 
Java :: how to implement linked list in java without using collection framework 
Java :: how to set event priority in spigot 
Java :: how to make plugin wait spigot 
Java :: flutter request location permission 
Java :: android manifest internet permission 
Java :: floatingactionbutton image color 
Java :: java cast bolean to int 
Java :: Which activity lifecycle method will call in Following Scenario - Launch ActivityA - Press Device Home Button - Again Launch Application * 
Java :: java reduce sum 
Java :: how to set view width programmatically in android 
Java :: plus one java 
Java :: how to check if page in webview or not in android studio 
Java :: comment out and uncomment in netbeans java 
Java :: jersey test dependency 
Java :: java how to center window 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =