CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    10

    Raster/DataBuffer via network ?

    Hi there,

    I got the following problem.
    I created a small client-server architecture. The server reads images from a webcam. Now a client can open a connection to the server and request an actual image to be sent his way. So far this works all right. Only that, at the moment, I am using object streams to do that (sending an Image object).

    But what I´d like to do is converting the Image to a BufferedImage (which also works already) and then send the raw data via the network (Raster->DataBuffer). But I sincerely have now idea how to do that. How do I go about writing and reading such files/data?

    I actually don´t know if that will be faster or better. Or if there is an even better way to do that.

    Any help is greatly appreciated. I am pretty new to Java.

    Oceansoul

  2. #2
    Join Date
    Feb 2007
    Posts
    40

    Re: Raster/DataBuffer via network ?

    Well... have you tried just calling BufferedImage.getData() , sending the returned Raster object the same way you are sending the Image object now, then calling the setData() method on the BufferedImage on the client side?

  3. #3
    Join Date
    Mar 2008
    Posts
    10

    Re: Raster/DataBuffer via network ?

    Hm, actually no. I´ll give that a try.
    While searching for info in the web I came acrosse several code snippets regarding similar topics. And those seemed to suggest to do the streaming byte-wise (stream.writeByte() ...). So I assumed that was the way to go. Only I couldn´t adapt it to my specific problem (as described above).

    Thanks.

    Oceansoul

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured