Results 1 to 4 of 4

Thread: Bitmaps and File I/O

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 1999
    Location
    NY
    Posts
    45

    Post

    This almost should go in Graphics and Games but it deals more with files.

    Im attempting my very first graphical program using DirectX, and became settled i could read two bitmaps, and put them (using Put with a random i/o file) into another one, and be able to access them easily through one file, and it'd also work great for animations. When it came to coding this, needless to say it didn't work or i'd be a happy coder.

    Now, if something is wrong with my *RAW FILE LOADING* please tell me:

    Dim it As String
    Open "c:\pic1.bmp" For Input As #1
    Open "c:\temp.bmp" For Output As #2
    While Not EOF(1)
    Line Input #1, it
    Print #2, it
    Wend
    Close #2
    Close #1

    (excuse the indent, Mozilla 5.0 doesn't allow it )
    The two files above *DO NOT MATCH IN SIZE*. The original picture is 29k, the resulting is 21k. It works for anything but a bitmap (exe, txt, zip), 'cept i didnt try other picture formats for the sake of my sanity.

    I want to be able to read two bitmaps, place them into a file, and access them such as:

    Get #1,1,StillFrame
    Get #1,2,WalkFrame1
    Get #1,3,WalkFrame2
    etc.

    Now if anyone can come up with a better (and easy, im highly inexperienced with graphics programming) solution, i'd also appreciate it. Thanks in advance.

    - Distressed Programmer

    ------------------
    -Mystiq



    [This message has been edited by mystiq (edited 01-24-2000).]

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Is there a good reason why you can't use FileCopy() ?

    and

    you could put your bitmaps in a resource file...

    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 1999
    Location
    NY
    Posts
    45

    Post

    Apparently you are not getting my purpose. I wouldn't FileCopy because that doesn't take two files and stick them into one. And how do you use Resource files? I never used em.

    ------------------
    -Mystiq

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    I haven't forgotten about you!
    It's probaby best to have a look at some samples
    the sample program
    C:\Program Files\DevStudio\VB\samples\PGuide\ATM\Atm.vbp

    uses resource files
    this is also at: http://msdn.microsoft.com/library/de...natmsamapp.htm

    and this one: http://support.microsoft.com/support.../q194/4/09.asp
    might be usefull as well!



    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company



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