|
Hi,
I think it may be a bit more complicated than it seems to be.
In the simplest form I would do something like this:
- decompress avi to a raw frame by frame format,
- draw text on every such frame,
- compress back to original format.
I doubt there a specific function for this task.
Regards
|
|
|
|
|
Yes
I neew to draw some text on images. For that reason I ned to save some text data in avi file. How can i do this?
|
|
|
|
|
What you call 'text' is in fact not text: it's just an image with certain pixels coloured so that you (as a user) can interpret it as text.
It is way more complicated that you think. You cannot just open the file and write your text somewhere in it so that magically your text will appear in the images.
If you want to do it by code, I think you can forget about it (or spend really a lot a lot of time, I even don't know if this is possible). The best solution is what you have been told: do it with a tool that lets you open the images one by one and draw the text yourself manually with the tool on the image. Then save everything after it.
|
|
|
|
|
In every "advanced" movie authoring software, such operation can be described exactly as:
-decompress to frames
-draw text on every frame (for specified time in stream of course)
-apply filters
-compress
Regards
|
|
|
|
|
Hi,
Thanks to all who replied /answered my queries. I solved my problem with some R and D. Actually my intention was to save some text data into AVI file.(text data means some xml file specific to my application). As we know we can save bitmap audio and text data in AVI file I was used same method as image for text with only format change like FOURCC code 'txts' instead of 'vids' etc.
If I need any more help I will again post a new question as always
Thanks again for all replies
Regards,
Hemant.
|
|
|
|
|
Hi Hemant,
Could you give some more info about how you opened and wrote to the 'txts' stream? A code snippet would be great!
Thanks,
Adi
|
|
|
|
|
I have a problem with memory when I put this code to insert a propertySheet into my CFormView
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER);
m_myPlanningSheet = new CPlanningSheet(_T("sheet"),pwndPropSheetHolder,0);
if (!m_myPlanningSheet->Create(pwndPropSheetHolder,
WS_CHILD | WS_VISIBLE, 0))
{
delete m_myPlanningSheet;
m_myPlanningSheet = NULL;
return;
}
// fit the property sheet into the place holder window, and show it
CRect rectPropSheet;
pwndPropSheetHolder->GetWindowRect(rectPropSheet);
m_myPlanningSheet->SetWindowPos(NULL, 0, 0,
rectPropSheet.Width(), rectPropSheet.Height(),
SWP_NOZORDER | SWP_NOACTIVATE);
I don't know what's the problem i put new then selete to allocate and to free
zizzzzzzzz
|
|
|
|
|
The problem is that you call delete only when Create fails.
You should call delete once you are done with PropertySheet.
Regards
|
|
|
|
|
special thanks
thaaaaaaaannnnnkkkk you very veryyyyyyyyyyyyyyyyyy much
|
|
|
|
|
where should I put the second delete because i need it dispalyed until programm is close
I tried to put it in MainFrm in WM_ONCLOSE but it doesn't work
|
|
|
|
|
Try putting it in your CFormView's destructor, but It necessary to destroy its window first.
Regards
|
|
|
|
|
ok it's running
thank's very much
|
|
|
|
|
Hi,
How can v use installshield to run our software burnt on cd. The s/w has been developed in VC++ 6.0, Plz tell me the whole process from installing install shield and running the exe saved in cd
|
|
|
|
|
You should be able to find information about installation process in IS documentation.
As for autorun:
For example:
in the root of your cd, create autorun.inf containing following section:
[AutoRun]
open=application.exe
That's all folks.
Regards
|
|
|
|
|
I follow the following steps to write a simple record program
waveInOpen
waveInPrepareHeader
waveInAddBuffer
waveInStart
waveInGetPosition
waveInReset
waveInUnprepareHeader
waveInClose
The program runs with no errors.
But I create a file to record the voice.
HANDLE FileHandle = CreateFile( L"myTest.wav", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
The wav file was created.
But I play rhe wav file by windows media player.
It says there is an error.
Is there any problem with my code?
My part code is below.
<br />
HANDLE FileHandle = CreateFile( L"myTest.wav", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); <br />
WriteFile(FileHandle, &dwNumber, 4, &NumToWrite, NULL); <br />
SetEndOfFile(FileHandle); <br />
CloseHandle( FileHandle ); <br />
FileHandle = INVALID_HANDLE_VALUE;<br />
Can somebody help me?
Thanks a lot.
minihotto
|
|
|
|
|
minihotto wrote: WriteFile(FileHandle, &dwNumber, 4, &NumToWrite, NULL);
You know that your file will only be 4 bytes ? I hardly believe this a valid file format for a wav file. Check the documentation of the WriteFile[^] function.
Also, you will need to follow the format reaquired for a wav file (I don't know it but if you search on google, you could find it).
minihotto wrote: SetEndOfFile(FileHandle);
What are you trying to do here ?
|
|
|
|
|
I see. thnaks.
this is the example I find from internet
<br />
HANDLE FileHandle = CreateFile( "Test.wav", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); <br />
dwNumber = FCC("RIFF"); <br />
WriteFile(FileHandle, &dwNumber, 4, &NumToWrite, NULL); <br />
what is FCC?
I cant find it in the msdn.
can somebody help me ?
thanks a lot.
minihotto
|
|
|
|
|
It's probably a function that they developed themselves. But anyway, you first need to understand the file structure of the wav file in order to have something that can be played.
|
|
|
|
|
minihotto wrote: HANDLE FileHandle = CreateFile( L"myTest.wav", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
WriteFile(FileHandle, &dwNumber, 4, &NumToWrite, NULL);
SetEndOfFile(FileHandle);
CloseHandle( FileHandle );
FileHandle = INVALID_HANDLE_VALUE;
This file doesn't even have a header, and your code wrote only 4 bytes of data to it, so how would you want it to be played?
Regards
|
|
|
|
|
In addition use of CREATE_ALWAYS overwrite your file if its exist
|
|
|
|
|
Microsoft's WAV file format is well documented.
A quick GOOGLEY search found this one
WaveFormat[^]
By the way, FCC() is just somebody's function for dealing with FOURCC codes - four characters
which need to be written in order in a big-endian/little-endian integer world.
Mark
|
|
|
|
|
I stored the string "wellcome to my life" in file.
Later, when i tried
fflush(stdin);input>>tmp;
cout<<"string: "<<tmp<<endl;cout.flush();
the string="" is="" displayed="" only="" "wellcome"
would="" you="" mind="" telling="" me="" how="" to="" solve="" the="" problem
thanks=""
<div="" class="ForumSig">hehe
|
|
|
|
|
would you post complete code ?
|
|
|
|
|
Here is how it goes, thanks
void ReadList()
{
int n,i;
char *tmp = new char[255];
ifstream input(filename,ios::in);
if (!input)
{
cout<<"Khong mo duoc file"<<endl;
exit(1);
="" }
="" input="">>n;
for (i=0;i<n;i++)
{
="" fflush(stdin);input="">>tmp;
cout<<"Ten sinh vien: "<<tmp<<endl;cout.flush();getch();
fflush(stdin);input="">>tmp;
cout<<" Ngay sinh: "<<tmp<<endl;cout.flush();getch();
fflush(stdin);input="">>tmp;
cout<<" Lop: "<<tmp<<endl;cout.flush();getch();
fflush(stdin);input="">>tmp;
cout<<" Diem TBC: "<<tmp<<endl;cout.flush();getch();
cout<<"\n";
="" }
="" input.close();
}=""
<div="" class="ForumSig">hehe
|
|
|
|
|
Is there any problem in reading line by line or character by character,
while (input.good())
{
input.getline(tmp ,255);
cout<<tmp <<end;
}
|
|
|
|