Can somebody please tell we Why we use Matrix and canvas in android studio? : I am new to android, so can somebody please help me what this code is actually doing as I am unable to get its purpose, and I am unable to get why we are using matrix and CANVAS IN THIS


    **My Java Code**
        float ratioX = actualWidth / (float) options.outWidth;
        float ratioY = actualHeight / (float) options.outHeight;
        float middleX = actualWidth / 2.0f;
        float mieX));
        Log.d("middleY",String.valueOf(middleY));
        Matrix scaleMatrix = new Matrix();
        scaleMatrix.setScale(ratioX, ratioY, middleX, middleY);
               Canvas canvas = new Canvas(scaledBitmap);
        canvas.setMatrix(scaleMatrix);
        canvas.drawBitmap(bmp, middleX - bmp.getWidth() / 2, middleY - bmp.getHeight() / 2, new Paint(Paint.FILTER_BITMAP_FLAG));
       