I am developing a game where the user needs to click on an image in ImageView to rotate it. In each image, the crane rotates 90 degrees clockwise. But the image takes time to turn from the old to a new position. This makes gameplay difficult. I used the following:
protected void onCreate(Bundle savedInstanceState) { ... ... imgview = (ImageView)findViewById(R.id.imageView1); imgview.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Matrix matrix = new Matrix(); matrix.postRotate(90); Bitmap myImg = getBitmapFromDrawable(imgview.getDrawable()); Bitmap rotated = Bitmap.createBitmap(myImg,0,0,myImg.getWidth(),myImg.getHeight(),matrix,true); imgview.setImageBitmap(rotated); } });
I want to know if there is another way to rotate the image without creating a delay .
source share