Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android view to bitmap

public static Bitmap loadBitmapFromView(View v) {
    Bitmap b = Bitmap.createBitmap( v.getLayoutParams().width, v.getLayoutParams().height, Bitmap.Config.ARGB_8888);                
    Canvas c = new Canvas(b);
    v.layout(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
    v.draw(c);
    return b;
}
Comment

PREVIOUS NEXT
Code Example
Java :: java trim method 
Java :: android java display icon in action bar 
Java :: java sha256 hex digest 
Java :: how to preset a list java 
Java :: how to set landscape in android studio 
Java :: localdate to date java 
Java :: java random Double between 
Java :: spinner get item text 
Java :: check the string has spaces in it in java 
Java :: swing event enter key 
Java :: java button 
Java :: android studio get string from strings.xml 
Java :: java pause program until key pressed 
Java :: how to add transition between activities android studio 
Java :: how to truncate an array in java 
Java :: add certificate to java truststore 
Java :: spigot execute command as player 
Java :: android glide 
Java :: read csv java android 
Java :: android java convert double to 2 decimal places 
Java :: install java 8 arch 
Java :: package within another java 
Java :: slice array java 
Java :: rewrite file java 
Java :: eval in java 
Java :: add seconds to today date and time java 
Java :: select word from array 
Java :: get type of variable java 
Java :: kotlin string interpolation 
Java :: how to format numbers in java 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =