Results 1 to 2 of 2

Thread: Saving JPG's in data files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Location
    St. Louis MO
    Posts
    129

    Saving JPG's in data files

    I've been goofing around writing a tile sliding game. You have a image and it slices it up, you put the peices back together etc...

    My problem is saving/loading the game. I'd like to get everything written into one file, but the image is in a picturebox and I can't "put" it like with everything else.

    Below is the current code, it fails when it tries to put the image from the picturebox.

    iFileNumber = FreeFile
    Open iFileName For Binary As iFileNumber
    Put iFileNumber, , MoveCount
    Put iFileNumber, , GridArray
    Put iFileNumber, , picMainPic.Image
    Close iFileNumber

    The load currently looks like this: It also fails on the picMainPic.Image line.

    iFileNumber = FreeFile
    Open iFileName For Binary As iFileNumber
    'Read data
    Get iFileNumber, , MoveCount
    Get iFileNumber, , GridArray
    Get iFileNumber, , picMainPic.Image
    Close iFileNumber

    So I guess my question is, if I can't use "Put" and "Get" on the image, how do I process it?

    Thanks in Advance.

  2. #2
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    im not 100% sure about this, but i think that the image variable only contains the address to the data in the memory.

    try using a DIB and save the image data as an array of the colors
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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