Results 1 to 2 of 2

Thread: This is a load of crap!!!

  1. #1
    B2E
    Guest

    Angry This is a load of crap!!!

    I a making a game and i am saving the bitmaps to my own type of binary file, here is were i am lost once i load the bitmaps into memory from the binary file that i saved them in i do not know how to make them useable agian, i loaded them back in and they are in something like

    dim bgimage as byte

    bgimage(0)

    and i loaded the bitmap as the bgimage!?!?

    does anyone know how i can get it back to a useable image
    i am lost as an unsaved sinner but any way PLEASE HELP ME!! anyone i just do not know were to go from here ???? any help would be greatly appreciated!!!!
    i might even hook you up with some free stuff from my BizNas at www.buy2easy.com

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Using the Get/Put commands, you can store User Defined Types and get them back again. For example:
    VB Code:
    1. Private Type UDT
    2.    ImageFileName As String
    3. End Type
    4. Function Save()
    5. Dim A As UDT
    6.    R = InputBox("What is the file's name that you want to load?")
    7.    If R = "" Then Exit Function
    8.    A.ImageFileName = R
    9.    Open App.Path & "\data" For Random As #1
    10.       Put #1, , A
    11.    Close #1
    12. End Function
    13. Function Load() As Picture
    14. Dim A As UDT
    15.    Open App.Path & "\data" For Random As #1
    16.       Get #1, , A
    17.    Close #1
    18.    Set Load = LoadPicture(A.ImageFileName)
    19. End Function
    20. Private Sub Command1_Click()
    21.    Save
    22.    Set Me.Picture = Load
    23. End Sub
    I made the code work
    Last edited by Sastraxi; Feb 5th, 2002 at 03:49 PM.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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