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. from array byte to bitmap

from array byte to bitmap

Scheduled Pinned Locked Moved C#
csharpgraphicssysadmindata-structureshelp
4 Posts 4 Posters 6 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.
  • H Offline
    H Offline
    heba abu ghaleih22
    wrote on last edited by
    #1

    hi... i send image as byte from server (this work in c# program ) i want ask how to receive this byte array in wp7 client and convert it bitmap? plz i need ur help

    OriginalGriffO 1 Reply Last reply
    0
    • H heba abu ghaleih22

      hi... i send image as byte from server (this work in c# program ) i want ask how to receive this byte array in wp7 client and convert it bitmap? plz i need ur help

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Assuming you have actually received the bytes, it's easy:

       MemoryStream ms = new MemoryStream(bytes);
       Image returnImage = Image.FromStream(ms);
      

      Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      B 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Assuming you have actually received the bytes, it's easy:

         MemoryStream ms = new MemoryStream(bytes);
         Image returnImage = Image.FromStream(ms);
        

        Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water

        B Offline
        B Offline
        BobJanova
        wrote on last edited by
        #3

        Well, that depends if the content in the stream is a valid image file that's just been streamed. I think more information about what's in that array of bytes is necessary.

        N 1 Reply Last reply
        0
        • B BobJanova

          Well, that depends if the content in the stream is a valid image file that's just been streamed. I think more information about what's in that array of bytes is necessary.

          N Offline
          N Offline
          nortee
          wrote on last edited by
          #4

          Hi Hi, From what I see from OriginalGriff's response (and the original query) he is correct. As long as the receiving end is expecting an image in the stream being sent then all should be rendered okay. I've personally used this technique on a few occasions and it worked quite nicely. Having said that, I also see the point you are making and I believe that some kind of error checking or (what I prefer using) handshake response/acknowledge to ensure that what data is being streamed is what is to be expected and will therefore be implemented properly. Just me two cents :),

          Cheers, Glen Vlotman "You cannot code for stupidity"

          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