Results 1 to 2 of 2

Thread: Fastest way

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jan 2000
    Location
    Otanmäki, Finland
    Posts
    7

    Post

    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

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post

    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
    [email protected]
    ...
    Every program can be reduced to one instruction which doesn't work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width