In Unity, How do I rotate the sprite image file?

Viewed 22

In Unity, I even finished taking a screenshot with my cell phone, transforming it into sprite, and storing it in a separate list variable. But I want to save this image after rotating it 90 degrees before saving it.

Transform.rotation does not work because it is in sprite format. What should I do?

        byte[] bytes2 = System.IO.File.ReadAllBytes(photoname);
        Debug.Log(bytes2 + "bytes ");
        Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
        texture.filterMode = FilterMode.Bilinear;
        texture.LoadImage(bytes2);
        Sprite sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
0 Answers
Related