ImageView imageView = findViewById(R.id.my_image_view); Matrix matrix = new Matrix(); matrix.setScale(2, 2); imageView.setImageMatrix(matrix);
ImageView imageView = findViewById(R.id.my_image_view); Matrix matrix = new Matrix(); matrix.setRotate(45); imageView.setImageMatrix(matrix);This code creates an ImageView object, then creates a new Matrix object and sets the rotation angle to 45 degrees. Finally, the setImageMatrix() method is called on the ImageView object with the newly created matrix object. Package library: android.widget.ImageView is part of the Android SDK, so no external package or library is required to use this class.