Results 1 to 3 of 3
  1. #1
    mdemir10 is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default socket communication between c++/java and sending image

    hi,

    i have a class in c++ called win32_sockserver which creates socket to java. i am trying to send image c++ to java and using the most basic method. i am sending image's rgb values as a string. But i have a problem:

    i want to send images continuosly, like frames of video. how can i do this.

    secondly, is there an easy way of sending images through c++ to java ?

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    5

    Default

    "i have a class in c++ called win32_sockserver which creates socket to java. i am trying to send image c++ to java and using the most basic method. i am sending image's rgb values as a string. But i have a problem:"

    Does that mean you have something that works for one image?

    "secondly, is there an easy way of sending images through c++ to java ?"

    No. The fact that one end of the pipe is c++ and the other is java doesn't particular matter, you are just sending bytes from one place to the other. What is difficult is figuring out what those bytes mean on the other side.

    When you say you send as a c++ string, what is that you mean: a c++ string object or a char[] with or without a '\n' at the end of it?

    What is your plan in taking these bytes and forming an image out of it when you get to the java side? Are you going to draw it by hand using the rgb values or do you plan to write it to a file as a jpg or some other file format?

    "i want to send images continuosly, like frames of video."

    The question i would ask is... how do you plan to compress your data?
    Last edited by mrmatt1111; 09-09-2009 at 06:39 PM.
    My Hobby Project: LegacyClone

  3. #3
    mdemir10 is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default

    in c++ side, i use open cv and after getting every pixel's rgb values, it sends them in char[]. there is no delimiter, but i can.

    code i written is very primitive, it doesnt use any compession method, only sends rgb values, but speed is sufficient for me.

    in java side, after getting rgb values, by using MemoryImageSource class, i am loading rgb values to class using pixel[].

Similar Threads

  1. Socket Communication on different networks
    By ersachinjain in forum Networking
    Replies: 4
    Last Post: 09-05-2009, 02:32 AM
  2. Sending a file through socket
    By sureshkumarcs88 in forum Networking
    Replies: 2
    Last Post: 03-14-2009, 07:32 AM
  3. problem in socket connection in sending images
    By vibhor in forum Networking
    Replies: 2
    Last Post: 02-20-2009, 05:39 AM
  4. Replies: 1
    Last Post: 02-10-2009, 09:16 AM
  5. Sending Image Objects through the Clipboard
    By Java Tip in forum java.awt.datatransfer
    Replies: 0
    Last Post: 04-16-2008, 10:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •