|
What type of file are you trying to load, and which richTextBoxStreamType are you using?
|
|
|
|
|
here is my function to load the file
void OpenFile()
{
openFileDlg.DefaultExt = "*.txt";
openFileDlg.Filter = "Text Files|*.txt";
if(openFileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK &&
openFileDlg.FileName.Length > 0)
{
rtxt.LoadFile(openFileDlg.FileName, RichTextBoxStreamType.UnicodePlainText);
}
}
|
|
|
|
|
Load it as PlainText instead of UnicodePlainText
This should solve your problem
James
|
|
|
|
|
I know that if I used PlainText, this problem wouldn't happen. But I have to use UnicodePlainText because my file is Vietnamese, it needs font Unicode.
|
|
|
|
|
Hello all,
I'm trying to create an EventHandler delegate from a MethodInfo object. When I call Delegate.CreateDelegate and pass it the EventHandler type and my MethodInfo object, I get the following error.
Error Binding to Target Method
Now, the signature of the method I am attempting to bind is of the correct type (it will allow me to bind to it directly as an EventHandler), but I can't get it working using MethodInfo.
Does anyone have any ideas? This is driving me nuts.
Will
|
|
|
|
|
i made an edge detection to a face and i want to fill the region inside the edges with white color in order to obtain the face from the original picture to this face.......can any one tell me how to fill the entire region of the edges with the white color?
i made a face detection before using the skin color detection but the results wasn't satisfy so i decided to try this algorithm and i wish to success
haitham
|
|
|
|
|
If you have a point inside the region and can be sure the edges don't have any gaps, you should start reading into flood filling algorithms.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
|
which algorithm do u prefer?
1-skin detection but the brightness inside the picture will be harmful in the segmentation(i can adjust the environment while taking pictures)
2-this algorithm but i don't have experience with gaps through the edges....but this algorithm will give the full face and the lightness will not affect as in the first choice
haitham
|
|
|
|
|
I have a form with 2 controls a textbox and a button.When i press the button i'd like it says the text in the textbox.It likes text to speech of Microsoft.How to do it?
|
|
|
|
|
Hi,
Ok, according to my knowledge, you have two choices, one is using SAPI class, another is using Microsoft Agent. Microsoft Agent is more tempting and attractive, but in order to explain easily, I am showing you using SAPI way.
Add reference from COM tab: Microsoft Speech Object library
then use these statements at the top of your class,
using SpeechLib;
using System.Threading;
Then use background Worker named "backgroundWorkerLetterTalker" , You can proceed without background worker but then your controls will be held frozen until speak method is finished.
Say your speak button name is "btnSpeakLetter"
and textbox name is "bodyRichTextBox"
Add event handler for Background worker DoWork named "speakLetter"
Add event handler for background worker Completed named "skeapLetter_Completed"
Add event handler for button btnSpeakLetter named "btnSpeakLetter_Click"
Now add these following code
// ///////////////////////////// SPEAK Method // //////////////////////////////////////
private void btnSpeakLetter_Click(object sender, EventArgs e)
{
btnSpeakLetter.Enabled = false;
backgroundWorkerLetterTalker.RunWorkerAsync(bodyRichTextBox.Text);
}
private void speakLetter(object sender, DoWorkEventArgs e)
{
string arg = (string)e.Argument;
SpVoice objSpeech = new SpVoice();
objSpeech.Speak(arg, SpeechVoiceSpeakFlags.SVSFlagsAsync);
objSpeech.WaitUntilDone(Timeout.Infinite);
}
private void skeapLetter_Completed(object sender, RunWorkerCompletedEventArgs e)
{
btnSpeakLetter.Enabled = true;
}
// ///////////////////////////////////////// X ///////////////////////////////////////
Nicely working in .NET 2.0 C# Express 2005. I did not test in the previous version.
EMRAN
-- modified at 8:12 Saturday 25th February, 2006
|
|
|
|
|
I used
using SpeechLib;
using System.Threading;
and copy your code but when i debug it generated an error.It does not understand DoWorkEventArgs and RunWorkerCompletedEventArgs.By the way could you tell me which class that the object backgroundWorkerLetterTalker belongs to?How to create this object?
Regards.
|
|
|
|
|
Hello,
Ok, The code file where I am using BackgroundWorker i have following using statements, you can just copy all of them for the time being for debugging purpose.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using SpeechLib;
using System.Threading;
Moreover Backgroundworker is a control available in your C# ToolBox. It is a new component in .NET 2.0 (2005 Express Editition). So, if you are using .Net 1.1 (Visual Studio 2003) then dont use this code.
"By the way could you tell me which class that the object backgroundWorkerLetterTalker belongs to ?"
:: backgroundWorkerLetterTalker was an instance variable name of BackgroundWorker Control, not any standard .net class name.
OK, If you have too much trouble about Background worker, then forget about backgroundWorker.
For simplicity, just to test Text to Speech, put this code without background worker. At least you will hear voice from machine.
private void btnSpeak_Click(object sender, EventArgs e)
{
///////////////////////////////////////////////////////////
string arg = "HEllo I am speaking";
SpVoice objSpeech = new SpVoice();
objSpeech.Speak(arg, SpeechVoiceSpeakFlags.SVSFlagsAsync);
objSpeech.WaitUntilDone(Timeout.Infinite);
///////////////////////////////////////////////////////////
}
-- modified at 13:30 Monday 27th February, 2006
|
|
|
|
|
HI,thanks for your reply
I've tried your code.It had no error but nothing happened either.I can not hear anything.
|
|
|
|
|
Hi I have built a project for you and sent you email with an zip file attachment. This project is working perfectly in my PC. If it is not working in your pc, then may be your pc is not equipped with microsoft speech features or may be something else wrong. And this project is built in .NET 2.0 (C# express 2005). If you have the previous version, then just open the file form1.cs and see the code and then use in your previous version IDE.
|
|
|
|
|
HI my email address is khoilvthu@yahoo.com.Please send the zip file to this address.Thanks lots
|
|
|
|
|
I'm thinking of making a VoIP program because the voice convo's in MSN messenger only connect like half the time. Can anyone direct me to some good articles or give me some advice on where to start?
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
|
Those seem to be good libraries but I can't add them as a reference in my project. It says they are an invalid COM component.
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
Hello i have a program that is using oledb stuff and it has an openfile dialog whenever i go in the openfile dialog and select a file anytime after that a oledb object gets called the program crashes why is openfile dialog affecting my database classes. the open file does nothing but return a string to my program
|
|
|
|
|
What is the error you are getting?
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
"System.Data.OleDb.OleDbException: Could not find file 'D:\\AttendanceDB.mdb'.\r\n at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)\r\n at System.Data.OleDb.OleDbConnection.InitializeProvider()\r\n at System.Data.OleDb.OleDbConnection.Open()\r\n at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)\r\n at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at SanMarCalendar.SanMar.cmbGroups_SelectedIndexChanged(Object sender, EventArgs e) in d:\\sanmar\\sanmarcalendar\\forms\\sanmar.cs:line 1338"
i never even told it to set it to that file or any other file the proper location of the file is set by default to ../../AttendanceDB.mdb but for some reason whenever i use an openfile dialog it sets it to the above. and gives me this exception why is openfile dialog changing my oledbConnection string
|
|
|
|
|
Have you tried giving the connection string the entire physical path of the DB just to see if it still does it? Mabey you could try changing the path so something like:
Application.StartupPath() + "\AttendanceDB.mdb";
and see if it still gives you the error.
Wacky waving inflateable arm flailing tube man!
- Family Guy
|
|
|
|
|
the connections all work fine untill i open the open file dialog then they all die once i try to use them after the open file dialog
it actualy looks like whenever i call fill on an adapter it dies after the open file dialog
the open file dialog has nothing to do with the database stuff.
|
|
|
|
|
This is more-than-likely because your connection string isn't specifying a complete path to your database, something like "DataSource=mydata.mdb". Since you left out the fully qualified path, it is assumed that the database is in the current directory.
The OpenFile dialog will change the current directory to whatever was picked in the dialog, thereby breaking the path to your database. ALWAYS use fully qualified paths when working with any kind of files.
string dbPath = Path.Combine(Application.StartupPath, "myData.mdb");
string connString = String.Format("blah;DataSource={0};", dbPath);
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|