Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Cannot make a static reference to the non-static method (http://www.chiefdelphi.com/forums/showthread.php?t=105559)

Team3881 10-04-2012 19:55

Cannot make a static reference to the non-static method
 
Or, more specifically, "Cannot make a static reference to the non-static method getImage() from the type AxisCamera."

The code is just

Code:

ColorImage image = AxisCamera.getImage();
But eclipse just gives that error.

I am sure I'm missing something simple, and/or something huge. Help would be appreciated.

Jared Russell 10-04-2012 20:01

Re: Cannot make a static reference to the non-static method
 
You need to get an instance of an AxisCamera before you can call that method.

Example:
Code:

// Typically you only want to do this ONCE; camera should be a class member
AxisCamera camera = AxisCamera.getInstance();

// Then you can get the image as often as you would like (but it's pretty slow, you don't want to call this more than once per 50 milliseconds or so!
ColorImage image = camera.getImage();



All times are GMT -5. The time now is 10:04.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi