Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Native Image not found help

Native Image not found help

Scheduled Pinned Locked Moved C#
helpquestionc++sysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Silvyster
    wrote on last edited by
    #1

    I'm creating a simple remoting application on images and this is how my program goes. There's a server and there's a client and there's this DLL file that they commonly use so that they can communicate to each other remotely... The server contains the images. So when the client is executed, it contacts the server to get a specific image. So the request is successfuly sent to the server. The server found the image so it made use of the "Image theImage = Image.getFromFile('etc. etc.')" function.. it was successful, (i'm assuming the image now is in the "theImage" variable)... so the next thing the server to do now is to send the image back to the client to be displayed on a picture box... then BAAMM!! then the error popped out on the client side that "Native Image Not Found". How do i resolve this?

    A K 2 Replies Last reply
    0
    • S Silvyster

      I'm creating a simple remoting application on images and this is how my program goes. There's a server and there's a client and there's this DLL file that they commonly use so that they can communicate to each other remotely... The server contains the images. So when the client is executed, it contacts the server to get a specific image. So the request is successfuly sent to the server. The server found the image so it made use of the "Image theImage = Image.getFromFile('etc. etc.')" function.. it was successful, (i'm assuming the image now is in the "theImage" variable)... so the next thing the server to do now is to send the image back to the client to be displayed on a picture box... then BAAMM!! then the error popped out on the client side that "Native Image Not Found". How do i resolve this?

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      You'll want to be sending that image as a stream, then recreating a bitmap from that stream. It's quit simple really:

      [server]
      Bitmap img = new Bitmap(@"path");
      Stream myStream = new MemoryStream();
      img.Save(myStream, ImageFormat.Bmp);
      ...
      [client]
      Bitmap img = new Bitmap(myStream);

      If this is what you'r already doing then err... I don't know. Sorry.

      My current favourite word is: Nipple!

      -SK Genius

      Game Programming articles start -here[^]-

      S 1 Reply Last reply
      0
      • A Anthony Mushrow

        You'll want to be sending that image as a stream, then recreating a bitmap from that stream. It's quit simple really:

        [server]
        Bitmap img = new Bitmap(@"path");
        Stream myStream = new MemoryStream();
        img.Save(myStream, ImageFormat.Bmp);
        ...
        [client]
        Bitmap img = new Bitmap(myStream);

        If this is what you'r already doing then err... I don't know. Sorry.

        My current favourite word is: Nipple!

        -SK Genius

        Game Programming articles start -here[^]-

        S Offline
        S Offline
        Silvyster
        wrote on last edited by
        #3

        yup.. i sent it as stream.. cause i thought you can just pass image objects that easy.. anyways thanks for the help

        1 Reply Last reply
        0
        • S Silvyster

          I'm creating a simple remoting application on images and this is how my program goes. There's a server and there's a client and there's this DLL file that they commonly use so that they can communicate to each other remotely... The server contains the images. So when the client is executed, it contacts the server to get a specific image. So the request is successfuly sent to the server. The server found the image so it made use of the "Image theImage = Image.getFromFile('etc. etc.')" function.. it was successful, (i'm assuming the image now is in the "theImage" variable)... so the next thing the server to do now is to send the image back to the client to be displayed on a picture box... then BAAMM!! then the error popped out on the client side that "Native Image Not Found". How do i resolve this?

          K Offline
          K Offline
          Karthik Kalyanasundaram
          wrote on last edited by
          #4

          You can try out this. In Server, 1. Read the image from the file. 2. Save the image onto a MemoryStream object. 3. Get the buffer from the MemoryStream using GetBuffer() method, this method will return the bytes from the memory stream. Now you send this byte array to the client. Now In Client, 1. Create new MemoryStream object and write the byte array received from server onto the MemoryStream. 2. Create new Image object from the MemoryStream using Image.FromStream() method and use this image object in the PictureBox.

          Do more work Make more mistakes Learn more things

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups