Tor Henrik Hovi
Member
I recive an array of bytes from a USB 2.0 device.
The array is a 800x600 grayscale picture.
The array is named Buffer
I use this code to present the image:
Private Sub BuildImage()
Dim Gray As Byte
Dim c, x, y As Integer
c=0
For y = 0 To 599
For x = 0 To 799
Gray = Buffer(c)
VideoBitmap.SetPixel(x, y, Color.FromArgb(Gray, Gray, Gray))
c = c + 1
Next
Next
End Sub
I takes about .5 sec to complete this on my PC. Wich gives me a frame rate of 2 pictures per sec.
Im looking for a faster way of displaying the picture.
Probably setpixel is not the fastest way?
As you see I have to make a RGB code for the grayscale Color.FromArgb(Gray, Gray, Gray).
Is there some way of inserting the grayscale values directly?
Thanx in advance
The array is a 800x600 grayscale picture.
The array is named Buffer
I use this code to present the image:
Private Sub BuildImage()
Dim Gray As Byte
Dim c, x, y As Integer
c=0
For y = 0 To 599
For x = 0 To 799
Gray = Buffer(c)
VideoBitmap.SetPixel(x, y, Color.FromArgb(Gray, Gray, Gray))
c = c + 1
Next
Next
End Sub
I takes about .5 sec to complete this on my PC. Wich gives me a frame rate of 2 pictures per sec.
Im looking for a faster way of displaying the picture.
Probably setpixel is not the fastest way?
As you see I have to make a RGB code for the grayscale Color.FromArgb(Gray, Gray, Gray).
Is there some way of inserting the grayscale values directly?
Thanx in advance