Log in or register to post comments

Error: no overload for method 'RegisterTrackerEventHandler' takes '1'arguments

September 8, 2014 - 8:46pm #1
Im trying this sample code but when i compile there an error on this line."qcarBehaviour.RegisterTrackerEventHandler(this);"
Error: no overload for method 'RegisterTrackerEventHandler' takes '1'arguments.
So, what wrong with it??

Unity Camera Image Access Sample Code

using UnityEngine;
using System.Collections;
 
public class CameraImageAccess : MonoBehaviour, ITrackerEventHandler
{
private Image.PIXEL_FORMAT m_PixelFormat = Image.PIXEL_FORMAT.RGB888;
private bool m_RegisteredFormat = false;
private bool m_LogInfo = true;
 
void Start()
{
QCARBehaviour qcarBehaviour = (QCARBehaviour) FindObjectOfType(typeof(QCARBehaviour));
if (qcarBehaviour)
{
qcarBehaviour.RegisterTrackerEventHandler(this);
}
}
public void OnInitialized ()
{
 
}
 
public void OnTrackablesUpdated()
{
if (!m_RegisteredFormat)
{
CameraDevice.Instance.SetFrameFormat(m_PixelFormat, true);
m_RegisteredFormat = true;
}
if (m_LogInfo)
{
CameraDevice cam = CameraDevice.Instance;
Image image = cam.GetCameraImage(m_PixelFormat);
if (image == null)
{
Debug.Log(m_PixelFormat + " image is not available yet");
}
else
{
string s = m_PixelFormat + " image: \n";
s += "  size: " + image.Width + "x" + image.Height + "\n";
s += "  bufferSize: " + image.BufferWidth + "x" + image.BufferHeight + "\n";
s += "  stride: " + image.Stride;
Debug.Log(s);
m_LogInfo = false;
}
}
}
}
 

 

Error: no overload for method 'RegisterTrackerEventHandler' take

September 12, 2014 - 10:26pm #3

Thanks, but i solve my problem a different way. I replaced qcarBehaviour.RegisterTrackerEventHandler(this); with this
"qcarBehaviour.RegisterTrackerEventHandler(this,false);"

Error: no overload for method 'RegisterTrackerEventHandler' take

September 11, 2014 - 8:05pm #2

That's a general C# error that might indicate that the compiler is looking at a different version of that same class/method. You might want to try going through the migration steps for Unity to see if it fixes the reference.

https://developer.vuforia.com/resources/dev-guide/migrating-your-unity-project

Log in or register to post comments