PDA

Click to See Complete Forum and Search --> : Fastest way


Merry VIP
Jan 12th, 2000, 06:13 PM
What is the fastest way to:
1) Read binary data file to a string buffer
2) Draw that code to picture box?

This is the way I have done it, first the data read and then the drawing:

Seek place, #1
Buffer=input(sizeofbuffer,#1)

For A = 0 to Xsize
For B = 0 to Ysize
Color = RGB(0,asc(mid(Buffer,B*Xsize+A,1)),0
'API call used to draw pixel to the picturebox, can't remember which one
Next B
Next A

Fox
Jan 12th, 2000, 06:34 PM
Try this:

-

Dim A As Long, B As Integer, Temp As Byte

Open FileName For Binary As #1
For A = 0 To XSize
For B = 0 To YSize
Get #1, , Temp
SetPixel( hdc, A, B, Temp)
'Or use RGB to draw in green
Next
Next
Close #1

-

------------------
Fox
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.