java Android - trabalhando com escalonamento de imagem / corte programaticamente

Bem, tudo isso me tortura por longas semanas, eu configurei uma imagem de 227 pixels de altura para 170 pixels, mesmo que eu queira que ela seja wrap_content sempre que eu quiser.

Está bem. Aqui eu tiro My Image, que tem 1950 pixels de comprimento (eu coloquei aqui uma parte para que você possa entender como deve ficar).

Primeiro, quero escalá-lo de volta para 227 pixels de altura porque foi assim que foi projetado e como deveria ser

Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),R.drawable.ver_bottom_panel_tiled_long);
            int width = bitmapOrg.getWidth();
        int height = bitmapOrg.getHeight();
        int newWidth = 200; //this should be parent's whdth later
        int newHeight = 227;

        // calculate the scale
        float scaleWidth = ((float) newWidth) / width;
        float scaleHeight = ((float) newHeight) / height;

        // create a matrix for the manipulation
        Matrix matrix = new Matrix();
        // resize the bit map
        matrix.postScale(scaleWidth, scaleHeight);

        // recreate the new Bitmap
        Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0, 
                          width, height, matrix, true); 


        BitmapDrawable dmpDrwbl=new BitmapDrawable(resizedBitmap);

    verbottompanelprayer.setBackgroundDrawable(dmpDrwbl);

então ... não é uma imagem cortada - não, são 1950 pixels pressionados em 200 pixels.

Mas eu quero apenas cortar qualquer coisa além desses 200 pixels ou qualquer largura que eu vou definir - cortá-lo e não pressionar toda essa imagem em 200 pixels de área.

Além disso, BitmapDrawable (bitmap bitmap); e imageView.setBackgroundDrawable (drawable); estão obsoletos - como posso mudar isso?

questionAnswers(1)

yourAnswerToTheQuestion