Thanks for help, I finally found solution, and put there for other people. I did that function:
private void captarpantalla(){
View view = getWindow().getDecorView().findViewById(android.R.id.content);
//añade extra el meno, mirar como quitar...
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
//int height = size.y;
if (high ==0){
int height = size.y;
Bitmap bitmap2 = Bitmap.createBitmap( width, height, Bitmap.Config.ARGB_8888);
Canvas c2 = new Canvas(bitmap2);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(c2);
Boolean encontrado = false;
height = height-1;
while (encontrado ==false){
if (bitmap2.getPixel(width/2, height)== Color.argb(000, 000, 000, 000)){
height = height - 1;
}else{
encontrado = true;
high = height;
}
}
}
Bitmap bitmap = Bitmap.createBitmap( width, high, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(c);
File imageFile = new File(settings.getString("pizarraactual", ""));
OutputStream fout = null;
try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 80, fout);
fout.flush();
fout.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
I calculate high, becouse if you dont do, when you take the screen, the pick have a black line in the bottom.
the code is a function of my program, "settings.getString("pizarraactual", "")" is the place for save the image.