- Home /
 
ToTexture2D() method not working
I am using the NUITRACK SDK for unity with Intel RealSense D415 camera. I am trying to display the RGB Stream from the camera onto a RawImage on the canvas. This error keeps appearing. 'ColorFrame' does not contain a definition for 'ToTexture2D' and no accessible extension method 'ToTexture2D' accepting a first argument of type 'ColorFrame' could be found (are you missing a using directive or an assembly reference?) The code is
 public RawImage background;
 void Start()
 {
     NuitrackManager.onColorUpdate += DrawColor;
 }
 // Update is called once per frame
 void Update()
 {
     
 }
 void DrawColor(nuitrack.ColorFrame frame)
 {
     background.texture = frame.ToTexture2D();
 }
 
              
               Comment
              
 
               
              Reinstalling Nuitrack SD$$anonymous$$ solved the issue
Answer by tahafarooq · Feb 20, 2019 at 05:50 PM
Hi,
I am having the same issue, did you find a solution yet ?
Answer by Jon_Ray · Dec 23, 2021 at 09:18 AM
Hi!
You need to add using NuitrackSDK.Frame;
(for the latest version of NuitrackSDK) 
Your answer