Hi, I`m a beginner in c/c++. I wrote a program with MSVC with allegro library which draws some graphics and then saves it from a buffer to a bitmap file. I want to save incremental filename bmp like 0000.bmp , 0001.bmp 0002.bmp etc. with an animation but I dont seem to find any references to how to do it. So could you please help me?
I thought that something like this might do the job but it faild:
I use to code with proce55ing in which, to do this kind of job i just have to write saveFrame("name-####.tga"); to get name-0001.tga , name-0002.tga etc.
string my_string1 = a_int_variable
string my_string2 = ".bmp";
string my_string3 = my_string1 + my_string2;
save_bitmap(my_string3, theBuffer, desktop_palette);
is there any simple way to do this? (sorry if my english is bad)
wsprintf would do this
wsprintf(FileName, "%03d.bmp", FrameNumber);
thx for the respnse.
wsprintf declared in Winuser.h and included in Windows.h,
after trying to compile the code i get " : error C2371: 'BITMAP' : redefinition; different basic types" because BITMAP seems to appear in windows.h and in allegro.h
how can I use wsprintf and allegro library without this conflict?
Why bother? Just use sprintf or the string class.