|
that's a big job especially for someone who never used sockets, anyways do you want to do the video in realtime? consider just sending the client program a copy of the video and then play it. there are tons of articles on sockets on this site.. also try msdn.microsoft.com[^]
IM PROUD TO BE A GMAIL;
|
|
|
|
|
hello,
I have a FileStream object in an OnChange event. Everytime OnChange is called, the code goes like this :
private void OnChanged(object source, FileSystemEventArgs e)
{
byte [] data = new byte[100];
try
{
fs.Read(data,offSet,fs.Length-offSet);
offSet = fs.Length;
changedText = trim(Encoding.ASCII.GetString(data));
doOperations(changedText);
}
catch(Exception ee)
{}
}
Now suppose on first OnChange call, 50 bytes were read, filling up the byte array (data) from index 0 to 49. The Problem starts on the next OnChange call. It continues to fill my byte array from 50 onwards, which finally results in the System.ArgumentException, when it reaches the array length 100. I need my byte array to be filled from 0 everytime OnChange is called. How can I do it?
regards
Zishan
|
|
|
|
|
lose the offset thing
look at msdn FileStream Read method :
[C#]
public override int Read(
[In,Out] byte[] array,
int offset,
int count
);
Parameters
*array
When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
*offset
The byte offset in array at which to begin reading.
*count
The maximum number of bytes to read.
Return Value
The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
HI,
Here from some 2-3 days i am facing some sort of problem in rotation image.
situation is like that:
there is a image (scanned ractangle) and its any where at A4 size page.I have to put that image on (0,0) of the A4 size page,so for that
i have to find out that what is rotation angle and Transformation angle
becoz by that i can rotate and translate my image and put it on my place(that is 0,0).
i got rotation angle perfactly ok.No problem but can some body tell me about how to find out translation matrix?
i am tring with translatetransform in matrix but i am slighly confused with matrix so can any body help me out in finding translation matrix.
thanks in advance.
regards,
montu3377
|
|
|
|
|
are you using managed dx?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I believe he is talking about System.Graphics not dx. Please answer the question since I don't have much time.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi ,
yeah i am talking about System.Drawing and I am using Matrix.TranslateTransform method for finding out the Translation required for the Rectangle.
Can any one know that how to findout the Translation in System.Drawing by using Matrix.TranslateTransform method.
There is littlebit confusion in finding the Translation of Rectangle so that's why i need help.
regards,
montu3377
|
|
|
|
|
I need textbox control wich automaticaly scroll down after the text in it has changed, but I don't know how exactly I could implement it.
If you have any idea please write.
Toximus
|
|
|
|
|
|
I couldn't find solution ...
Do you remember date or title?
xacc is quite impressive but it has some bugs
Toximus
|
|
|
|
|
|
Hi.
How can I remove a background Image of Windows form?
The background setted by property "this.backgrounImage".
Thanks
|
|
|
|
|
You could try:
this.BackgroundImage = null;
|
|
|
|
|
Right click "reset". Assuming that you are using Vs.net
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hallo,
while performing, my program serializes some data into files. My problem is, that these files are not deleted when the program is uninstalled.
Is there any property in the setup project which can achieve that?
Thanks for your help,
Björn
|
|
|
|
|
You can create a DLL with a custom installer (a "custom action") and, on the UnInstall method, you remove the files.
Read the System.Configuration.Install.Installer docs for more information about this.
Yes, even I am blogging now!
|
|
|
|
|
im trying to write a effective file sharing program. The program should brake down a file into pieces (byte[]) and send them over the network to the client. The client should then return a recipt or something, letting the sender know that he just recieved the byte[] then repeat. in the event the client never sends a recipt, the sender will then resend the previous byte[]. What im asking is, what is a efficient way and effective way of doing this. obviously hashcodes would need to be employed to ensure the client has recieved the correct data. any ideas/code examples on how to do this would be much appreciated.
as it stands now i wrote a dll that automaticly deserializes (spelling),compresses,encrypts and sends it. the recieved does the oposite and then sends the newly formed object back. is there a easyier way of doing this?
thnx,
jesse
The Code Project Is Your Friend...
|
|
|
|
|
jtmtv18 wrote:
im trying to write a effective file sharing program
Depending on what you're trying to achieve, this is not easy.
jtmtv18 wrote:
The client should then return a recipt or something, letting the sender know that he just recieved the byte[] then repeat.
Unless you're using UDP packets, there's no need on doing this. TCP assures that the connection is either dropped or the packet is received.
jtmtv18 wrote:
obviously hashcodes would need to be employed to ensure the client has recieved the correct data.
Again, TCP assures that, and handle packet retransmissions automatically.
Yes, even I am blogging now!
|
|
|
|
|
|
is there a already established class or dll that would do the job ? i have noticed that the packets do send out of order sometimes.
The Code Project Is Your Friend...
|
|
|
|
|
hello i have a custom control with 2 buttons i need the control the raise an event with the parent only when 1 of the buttons is pressed. what is the proper way to do this?
any suggestions or a link to an article will be helpfull
thanks
|
|
|
|
|
You should make a custom event handle to your control.
The way to do this is to create a delegate and a evet handle to you control like this
public delegate void ControlButtonPressedHandle(object sender, EventArgs e);
public event ControlButtonPressedHandle ButtonPressed; and then create a method that invokes all your delegates
protected virtual void OnButtonPressed(EventArgs e)
{
if (ButtonPressed != null)
ButtonPressed(this, e);
} Once you have done al this you can add a delegate to you button to rise when it is clicked and invoke all you custom control delegates
private void button1_Click(object sender, System.EventArgs e)
{
OnButtonPressed(new EventArgs());
}
Finaly your control now has a button pressed delegate.
Hope this helps you.
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
and how would i use this to notify the parent that this happened?
|
|
|
|
|
into the paren constructor add the following
myControl.ButtonPressed += new ControlButtonPressedHandle(myFunction);
and into it's class add the following function
void myFunction(object sender, EventArgs e) {
}
this is what a delegate is for
I hope you understand...
By the way... visit http://nehe.gamedev.net[^]
|
|
|
|
|
I agree with you but why make your own delegate when you can use the normal EventHandler ?
|
|
|
|