- Home /
4.6 UI Image bug on some Windows 8 and 8.1
I'm making an interactive book for windows users and i'm using 4.6 UI system. I tested my application on lots of computers using various windows versions. It works fine with windows xp, windows 7, windows 8 and 8.1. But some of the windows 8 and 8.1 computers are producing a weird bug. Here is how it should look like
and here it is in windows 8
Btw i have lots of images in my application. I'm putting them in my project with .bytes extension and creating sprite on runtime. My code to do this is :
void TextAssetToSprite(int pNo)
{
TextAsset tmp = textAssetArray[pNo] as TextAsset;
Texture2D imgTexture = new Texture2D(1, 1);
imgTexture.LoadImage(tmp.bytes);
Rect rectangle = new Rect(0, 0, imgTexture.width, imgTexture.height);
Vector2 pivot = new Vector2(0.5f, 0.5f);
Sprite firstSprite = Sprite.Create(imgTexture, rectangle, pivot);
imageControl.sprite = firstSprite;
tmp = null;
imgTexture = null;
Resources.UnloadUnusedAssets();
}
I don't know what i'm doing wrong. I've done hours of research but found nothing similar. When i create sprite in the editor and use it on UI image component it works as expected but it's not an option because there are lots of png images in my application and it's size will be too much. Please suggest me a way to fix this. Any help will be greatly appreciated.
Your answer
![](https://koobas.hobune.stream/wayback/20220613201342im_/https://answers.unity.com/themes/thub/images/avi.jpg)