Changing pixel color to transparent on iPad air 2 not working?
Hi I've been working on and off with a project that let's a user draw a picture. Once the user is done and hits save, the pixels from the canvas are loaded into an array and any pixels which have the background colour (in this case Color.grey) are changed to Color.clear. The image is then saved.
This has worked for over a year now and has been tested on iPad 3/4 and also in my Unity as well, recently I've gotten access to an iPad Air 2 and the pixels aren't being saved as transparent, they're being saved as the background colour of grey.
The snippet that has worked for me prior to this is:
Color[] pixels = MyImg.GetPixels(0, 0, MyImg.width, MyImg.height, 0);
for(int i = 0; i < pixels.Length; i++)
{
if(pixels[i] == Color.grey)
{
pixels[i] = Color.clear;
}
}
MyImg.SetPixels(0, 0, MyImg.width, MyImg.height, pixels, 0);
MyImg.Apply ();
Obviously there's more code around it, but there has been nothing changed in the app which still works on my iPad 3 and still works in my own Unity, but doesn't work properly on the iPad Air 2. Can anyone think of what might be the issue? I'm very stuck on this and I'm still only learning so hopefully I've included sufficient detail to explain the issue. If there's anything else you need to know then please just ask and I'll do my best.
Any help would be appreciated!
N.