Open harishG2W opened 1 year ago
@yasirkula Hi Thanks for the great plugin. I am sharing the image like following but not able to see the image and text together in some selected apps
RenderTexture rt = new RenderTexture(resWidth, resHeight, 24); Camera.main.targetTexture = rt; Texture2D screenShot = new Texture2D(resWidth, resHeight, TextureFormat.RGB24, false); Camera.main.Render(); RenderTexture.active = rt; screenShot.ReadPixels(new Rect(0, 0, resWidth, resHeight), 0, 0); Camera.main.targetTexture = null; RenderTexture.active = null; // JC: added to avoid errors Destroy(rt); byte[] bytes = screenShot.EncodeToPNG(); string filename = G2WGameConstants.ScreenShotName(resWidth, resHeight); isSharing =true; new NativeShare().AddFile(filename) .SetSubject("Subject").SetText("Sharing text") .SetCallback((result, shareTarget) => isSharing = false ) .Share();
That's unfortunately expected:
@yasirkula Hi Thanks for the great plugin. I am sharing the image like following but not able to see the image and text together in some selected apps
RenderTexture rt = new RenderTexture(resWidth, resHeight, 24); Camera.main.targetTexture = rt; Texture2D screenShot = new Texture2D(resWidth, resHeight, TextureFormat.RGB24, false); Camera.main.Render(); RenderTexture.active = rt; screenShot.ReadPixels(new Rect(0, 0, resWidth, resHeight), 0, 0); Camera.main.targetTexture = null; RenderTexture.active = null; // JC: added to avoid errors Destroy(rt); byte[] bytes = screenShot.EncodeToPNG(); string filename = G2WGameConstants.ScreenShotName(resWidth, resHeight); isSharing =true; new NativeShare().AddFile(filename) .SetSubject("Subject").SetText("Sharing text") .SetCallback((result, shareTarget) => isSharing = false ) .Share();