🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

problems writing to files

Started by
3 comments, last by cyberg 24 years, 5 months ago
hi, i''m writing a pacman clone in dx7 and i want to take snap shot while in the game, by a function that i call when a press a key, but my function doesn''t work properly. there is how it work, i lock the surface and then i write to a file the surface row by row using WriteFile function of windows, but it happens that the function fail and i dont know why because it doesnt fail at all row of the surface. my surface is 800x600 and the bitmap isnt the size it must be. i really cant see what is the source of the problem, maybe some characters in memory that affect the WriteFile function... hope that someone can help. cyberg
cyberg- cyberg_coder@hotmail.com- http://members.xoom.com/cybergsoft
Advertisement
try approching it using either an ofstream object or stdio''s file i/o routines instead of using WriteFile.
You could just use the printscreen key
Are you trying to write the whole thing at once? Win32 can be extremely unhappy with large file writes. Try writing 10 scanlines at a time, and see if that works.
ok, it works now, thx for your help!

cyberg
cyberg- cyberg_coder@hotmail.com- http://members.xoom.com/cybergsoft

This topic is closed to new replies.

Advertisement