loading
 
C# getimage
Ivan from Russia  [2 posts]
15 year
Hello,

I use the API In my c# program

I do:

RR_API rr = new RR_API();
Dimension d = rr.getDimension();
byte[] image = new byte[640 * 480];
d = rr.getImage(image, 640 * 480);

but in array "image" I get only zeroes (image = {0,0,0, ... ,0})
and the variable "d" is always "null"

What's the problem on your opinion?

Anonymous 15 year
Hi Ivan,
   Did you try the first part of the code from the API

            if (!rr.connect("localhost"))
            {
              Console.WriteLine("Could not connect to localhost!");
              return;
            }

Are you connecting to the server ? Is the API Server turned on in RR?
Ivan from Russia  [2 posts] 15 year
Yes, I have connection and API server started.
Anonymous 15 year
Ivan,

Does the line

Dimension d = rr.getDimension();

return anything? You test case should look like

RR_API rr = new RR_API();
if (!rr.connect("localhost"))
{
  Console.WriteLine("Could not connect to localhost!");
  return;
}
byte[] image = new byte[640 * 480];
Dimension d = rr.getImage(image, 640 * 480);

as mentioned in the previous post. Seems like you are not connected correctly to the RoboRealm application. (Be sure that the app is running too!)

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index