We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public Texture2D tex;
var tex1 = TextureOps.Scale(tex, tex.width / 2, tex.height / 2, tex.format); yield return null; originalImage.sprite = Sprite.Create(tex1, new Rect(0, 0, tex1.width, tex1.height), new Vector2(0.5f, 0.5f), 100f, 0, SpriteMeshType.FullRect);
I tried to scale down the texture by using the above method and tried to apply to a image. But It always show some lines instead of original one
Image used
converted Image
Error : Unable to retrieve image reference UnityEngine.Texture2D:ReadPixels (UnityEngine.Rect,int,int,bool) TextureOps:Scale (UnityEngine.Texture,int,int,UnityEngine.TextureFormat,TextureOps/Options) (at ./Library/PackageCache/com.yasirkula.textureops@66623dae8d/Plugins/TextureOps/TextureOps.cs:467) ImageConvert/d__6:MoveNext () (at Assets/ImageConvert.cs:35) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Import settings
Unity 2022.3.7
Adding aspect ratio fill/scale will also a good option for this asset!
The text was updated successfully, but these errors were encountered:
I'd like to know if this is Compression related. Can you set it to None for testing purposes?
PS. Does TextureOps.ScaleFill satisfy the aspect ratio fill/scale you've mentioned?
Sorry, something went wrong.
If I didn't pass the format, it is working good
Haven't tested the fill API
No branches or pull requests
public Texture2D tex;
var tex1 = TextureOps.Scale(tex, tex.width / 2, tex.height / 2, tex.format);
yield return null;
originalImage.sprite = Sprite.Create(tex1, new Rect(0, 0, tex1.width, tex1.height), new Vector2(0.5f, 0.5f),
100f, 0, SpriteMeshType.FullRect);
I tried to scale down the texture by using the above method and tried to apply to a image. But It always show some lines instead of original one
Image used
converted Image
Error :
Unable to retrieve image reference
UnityEngine.Texture2D:ReadPixels (UnityEngine.Rect,int,int,bool)
TextureOps:Scale (UnityEngine.Texture,int,int,UnityEngine.TextureFormat,TextureOps/Options) (at ./Library/PackageCache/com.yasirkula.textureops@66623dae8d/Plugins/TextureOps/TextureOps.cs:467)
ImageConvert/d__6:MoveNext () (at Assets/ImageConvert.cs:35)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Import settings
Unity 2022.3.7
Adding aspect ratio fill/scale will also a good option for this asset!
The text was updated successfully, but these errors were encountered: