Unregistered
March 22, 2005, 03:16:47
Hello,
I am attempting to copy the pixel data from the image buffer to a byte array so that I can then send it through a socket over the network. I have been able to successfully do this but it is slow.
Slow code portion:
For y = 0 To ImgBuffer.Lines * ImgBuffer.PixelPerLine * ImgBuffer.BitsPerPixel / 8 - 1
bmpbyte(y + 54) = ImgBuffer(y) '54 offset is for BMP header
Next
My original method for sending was to save the image to disk, read it back and then put it into the array to send. That seems like a waste to perform all that disk accessing so I am looking for a better method.
Any suggestions on a quicker way to move the pixel data into an array?
I am attempting to copy the pixel data from the image buffer to a byte array so that I can then send it through a socket over the network. I have been able to successfully do this but it is slow.
Slow code portion:
For y = 0 To ImgBuffer.Lines * ImgBuffer.PixelPerLine * ImgBuffer.BitsPerPixel / 8 - 1
bmpbyte(y + 54) = ImgBuffer(y) '54 offset is for BMP header
Next
My original method for sending was to save the image to disk, read it back and then put it into the array to send. That seems like a waste to perform all that disk accessing so I am looking for a better method.
Any suggestions on a quicker way to move the pixel data into an array?