Results 1 to 4 of 4

Thread: bmp file format [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    bmp file format [RESOLVED]

    OK, my main question is, i have a series of 1's and 0's, and was wondering how to convert them into a black&white .bmp form, so i can view them from Paint or any other picture viewing program.
    Thanks

    Also, of similar topic, what do you need to create your own midi file? is it just notes & their length, and which instrument plays it? thanks.
    Last edited by sql_lall; Jul 27th, 2003 at 02:53 AM.
    sql_lall

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    If you go to

    http://www.wotsit.org/

    you can find file format descriptions for most things.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3

    Thread Starter
    Fanatic Member sql_lall's Avatar
    Join Date
    Jul 2002
    Location
    Up Above (i.e. AUS)
    Posts
    571

    Talking :D

    Thanks, very helpful
    sql_lall

  4. #4
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Re: creating own bmp

    Originally posted by sql_lall
    OK, my main question is, i have a series of 1's and 0's, and was wondering how to convert them into a black&white .bmp form, so i can view them from Paint or any other picture viewing program.
    Thanks

    Also, of similar topic, what do you need to create your own midi file? is it just notes & their length, and which instrument plays it? thanks.
    To create the bitmap you could loop through your data, and draw the pixels using SetPixel.

    Just need to do something like(tested code):

    VB Code:
    1. Private buftxt(32696) As String
    2. 'my picture had that many pixels
    3. Dim X As Long, Y As Long
    4. For i = 0 To ubound(buftxt)
    5. Picture1.PSet (X, Y), buftxt(i) * 16777215
    6. X = X + 1
    7. If X > Picture1.ScaleWidth - 1 Then
    8. X = 0
    9. Y = Y + 1
    10. End If
    11. DoEvents
    12. Next
    13.  
    14. 'to fill buftxt with random data:
    15.  
    16. For X = 0 To 32696
    17. buftxt(X) = Int(Rnd * 2)
    18. Next

    Pset was fast enough for me.

    Good luck,

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