Anything qucker than Image.FromStream
-
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
-
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
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
-
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
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.
-
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.
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
-
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
No there not videos. Its a frame from a IP camera along with other information and is sent from a server.
-
No there not videos. Its a frame from a IP camera along with other information and is sent from a server.
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 thenResumeLayout
andInvalidate
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
-
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 thenResumeLayout
andInvalidate
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
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