Search found 6 matches
- 10 Dec 2015, 14:59
- Forum: General Discussion
- Replies: 11
- Views: 8711
Re: [Unity] get Texture2D from textureSource?
It's works fine. I save the captured image to a file to check it and always works fine without exceptions. IEnumerator RenderAtEndOfFrame() { yield return new WaitForEndOfFrame(); _uiRenderer.PostRender(); Texture2D tex= new Texture2D(100, 100, TextureFormat.ARGB32, false); // Read screen contents i...
- 09 Dec 2015, 17:02
- Forum: General Discussion
- Replies: 11
- Views: 8711
Re: [Unity] get Texture2D from textureSource?
Hi jsantos, sorry for the late answer. Same error. The only way i've found to run ReadPixels() without this error is in an coRoutine after WaitForEndOfFrame(). I can't explain why... I guess only Unity people knows. In older versions of Unity (before 4)this error doesn't happens. And the capture wor...
- 04 Dec 2015, 18:03
- Forum: General Discussion
- Replies: 11
- Views: 8711
Re: [Unity] get Texture2D from textureSource?
I am not sure, i guess i need a Texture2d anyway.
Like i said before, I need to use the texture in a sprite, so i am using:
to do this.
And Sprite.Create need a Texture2d, not a RenderTexture. That's why i guess i must get the texture2d using ReadPixels().
Like i said before, I need to use the texture in a sprite, so i am using:
Code: Select all
Sprite.Create(customTexture, .....
And Sprite.Create need a Texture2d, not a RenderTexture. That's why i guess i must get the texture2d using ReadPixels().
- 03 Dec 2015, 16:39
- Forum: General Discussion
- Replies: 11
- Views: 8711
Re: [Unity] get Texture2D from textureSource?
I checked the Unity Forum looking for the error, and always solve it calling WaitForEndOfFrame() before ReadPixels(). http://forum.unity3d.com/threads/texture2d-readpixels-call-in-coroutine.155194/ http://answers.unity3d.com/questions/326384/texture2dreadpixels-unknown-error-not-inside-drawi.html If...
- 02 Dec 2015, 14:25
- Forum: General Discussion
- Replies: 11
- Views: 8711
Re: [Unity] get Texture2D from textureSource?
Hi again, and thanks for your answer. I need the Texture2d because I let the user to make his own logo, and then i use it in some sprites. 1)Load logos from ResourceDictionary. 2)The user choose one, and customize it (color, size..). 3)Then i want to get the Texture2d from the customized logo to use...
- 01 Dec 2015, 15:35
- Forum: General Discussion
- Replies: 11
- Views: 8711
[Unity] get Texture2D from textureSource?
Hi ! Using the sample from imagestutorial i could convert a texture2D to texturesource: Grid grid = GetComponent<NoesisGUIPanel>().GetRoot<Grid>(); Texture2D texture = Resources.Load("Noesis") as Texture2D; TextureSource source = new TextureSource(texture); Image image = grid.FindName<Imag...