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. Anything qucker than Image.FromStream

Anything qucker than Image.FromStream

Scheduled Pinned Locked Moved C#
data-structuresquestion
7 Posts 2 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.
  • T Offline
    T Offline
    TimSWatson
    wrote on last edited by
    #1

    Hey My program recieves a byte array containing a jpg. I am using Image.FromStream and then viewing the image on a picturebox. Image.FromStream is quite slow so is there any other way I could view the jpg? Thanks

    A 1 Reply Last reply
    0
    • T TimSWatson

      Hey My program recieves a byte array containing a jpg. I am using Image.FromStream and then viewing the image on a picturebox. Image.FromStream is quite slow so is there any other way I could view the jpg? Thanks

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

      I don't believe there is another way. Apart from loading it from the disk (which really, opens the file then reads it from the stream) There shouldn't really be any reason for it to go particularly slowly, unless it's a very large image. Could it be possible that something else is causing the lack of swiftness?

      My current favourite quote is: Punch them in the face, see what happens!

      -SK Genius

      T 1 Reply Last reply
      0
      • A Anthony Mushrow

        I don't believe there is another way. Apart from loading it from the disk (which really, opens the file then reads it from the stream) There shouldn't really be any reason for it to go particularly slowly, unless it's a very large image. Could it be possible that something else is causing the lack of swiftness?

        My current favourite quote is: Punch them in the face, see what happens!

        -SK Genius

        T Offline
        T Offline
        TimSWatson
        wrote on last edited by
        #3

        The problem is im recieving 16 video streams and each is 25fps. Thats 400fps and Image.FromStream is taking 3-4 ms per frame. Its just to slow.

        A 1 Reply Last reply
        0
        • T TimSWatson

          The problem is im recieving 16 video streams and each is 25fps. Thats 400fps and Image.FromStream is taking 3-4 ms per frame. Its just to slow.

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

          So you're trying to play video in a picture box? You may want to check some articles on video playback with DirectX.

          My current favourite quote is: Punch them in the face, see what happens!

          -SK Genius

          T 1 Reply Last reply
          0
          • A Anthony Mushrow

            So you're trying to play video in a picture box? You may want to check some articles on video playback with DirectX.

            My current favourite quote is: Punch them in the face, see what happens!

            -SK Genius

            T Offline
            T Offline
            TimSWatson
            wrote on last edited by
            #5

            No there not videos. Its a frame from a IP camera along with other information and is sent from a server.

            A 1 Reply Last reply
            0
            • T TimSWatson

              No there not videos. Its a frame from a IP camera along with other information and is sent from a server.

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

              Either way, trying to render pictures so fast is beyond the capabilities and intended use of GDI+ (which is what is being used to draw your pictures) The best you can do is call SuspendLayout on your picture boxes so that they don't redraw as soon as you've changed the picture and then ResumeLayout and Invalidate once you have updated all of your picture boxes. Reducing the number of redraws that are done, but even then I can't see it being very fantastic. Also, if your showing lots of different pictures one after the other at a reasonably quick pace, I'd say that was video.

              My current favourite quote is: Punch them in the face, see what happens!

              -SK Genius

              T 1 Reply Last reply
              0
              • A Anthony Mushrow

                Either way, trying to render pictures so fast is beyond the capabilities and intended use of GDI+ (which is what is being used to draw your pictures) The best you can do is call SuspendLayout on your picture boxes so that they don't redraw as soon as you've changed the picture and then ResumeLayout and Invalidate once you have updated all of your picture boxes. Reducing the number of redraws that are done, but even then I can't see it being very fantastic. Also, if your showing lots of different pictures one after the other at a reasonably quick pace, I'd say that was video.

                My current favourite quote is: Punch them in the face, see what happens!

                -SK Genius

                T Offline
                T Offline
                TimSWatson
                wrote on last edited by
                #7

                Ok thanx for the help. So if showing pictures at a quick pace is actually just a video surely I can use DirectX or DirectShow to play the "Video"? Or wont this be quick enough to do what I want? If not I will just have to reduce the frame rate. Thanks

                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