PDA

Click to See Complete Forum and Search --> : Bitmaps and File I/O


mystiq
Jan 24th, 2000, 10:05 AM
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).]

Mark Sreeves
Jan 24th, 2000, 09:18 PM
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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

mystiq
Jan 25th, 2000, 06:56 AM
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

Mark Sreeves
Jan 27th, 2000, 03:50 PM
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/devprods/vs6/vbasic/vbcon98/vbconatmsamapp.htm

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



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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company