|
Heath Stewart wrote:
My recommendation is - much like you did for the quality encoder parameter - adjust the compression algorithm as well until you find a happy medium. Perhaps find out which compressional algorithm Photoshop is using (LZH, IIRC) and use the same
I've investigated the matter, and it seems that whan saving image as JPEG, the only encoder paarameters that can be used are: Transformation and Quality. (As I noted before Quality when set even to maximum does not suit my needs). Compression encoder parameter is available only whan savig image as TIFF (available options are: none, LZW, Rle, CCIIT3, CCIIT4)
Thanks
Michał
|
|
|
|
|
does anybody have a link to a tutorial that is tried and tested and simple and accurate and etc. :P on how to use sockets in c#?
what i need to do is to connect to a specific ip on a certain port, send info and recieve and process it, then send more depending on what's been sent etc.
what type of connect is also best to use?
thanks.
-------------------------------------------------------
ithium is the best.
'Science without religion is lame, religion without science is blind.' --Albert Einstein
'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
|
|
|
|
|
There are several good ones here - use the ratings to see what people think is good.
As far as the protocol, that is defined entirely by you. Sockets are a simple connection between, well, sockets. That's it. More than likely, you'll want to use a TcpClient if you want to use TCP/IP for the connection protocol. What comes across the wire is defined by you, however.
Tons of protocols including HTTP, SMTP, FTP, etc. all use TCP/IP, but the protocol - the messages sent back and forth - is unique to each (though some common approaches exist, such as headers vs. body). In fact, someone earlier today simply asked about "telnet". Telnet is really just a simple TCP socket connection with know particular protocol.
A good way to handle this is to connect using a TcpClient and getting a NetworkStream by calling TcpClient.GetStream . Instantiate a StreamWriter and StreamReader on that stream with an agreed-upon encoding (like ASCII, UTF8, Unicode, etc.). Send and receive commands.
A good protocol will define errors codes that typically prefix a response message, making it quick and simple for you to determine if a command passed or failed.
For good examples of such protocols, I recommend you search http://www.ietf.org/rfc[^] for RFCs describing TCP protocols like SMTP, HTTP (pretty easy one), FTP, etc. I would recommend DICT (http://www.ietf.org/rfc/rfc2229.txt[^]), which I'm currently wrapping (slowly, with low priority). It's a simple protocol and gives you a pretty good idea of a good protocol design.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
This article http://www.codeproject.com/csharp/pop3client.asp[^] will help a lot because it is simple, uses sockets to send and receive data with a pop3 server (which is cleartext)... exactly what you want.
The best part is, if you're just doing this to learn, you dont need to write the server piece!
Microsoft .NET - Come on! I need the Traffic!
|
|
|
|
|
make a little pop3 class to talk to your email server and read your messages etc. You coul make a class for all the pop commands like AUTH, LIST etc. Read the pop3 rfc, its very simple. I did something like this, and it was a fun way to learn .net sockets...
/\ |_ E X E GG
|
|
|
|
|
thanks all.
-------------------------------------------------------
ithium is the best.
'Science without religion is lame, religion without science is blind.' --Albert Einstein
'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
|
|
|
|
|
hi - is there a simple and good way to control the 9-pin serial port at the back of your computer? i would like to use it for some simple electronics commands and i need to be able to send a certain number of pules to it over a set time,- also how can you recieve?
i found this link on google, is it right? and what is i don't want to send a message to want to pulse it? any ideas?
cheers,
surgeproof
-------------------------------------------------------
ithium is the best.
'Science without religion is lame, religion without science is blind.' --Albert Einstein
'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
|
|
|
|
|
Simple? Not on your life...
You said your looking to send signal pulses? The article you found won't let you do that. That article deals with properly formatted serial communications. You're apparently looking at manipulating the serial port hardware directly and in very non-standard methods. Your going to have a DIFFICULT time with this one. Receiving data is going to be very difficult at best.
You might have better luck with using the parallel port for a project like this. Most of the same problems apply, but there is more documentation on this port than with serial. For example...[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I agree with Dave, what you're trying to do is pretty impossible.
Better to get hold of a development kit for a simple microcontroller (e.g. a Arizona Micro PIC device) that has an on-baord UART and talk to that via your PC serial port. The PIC can be programmed to generate your pulses, etc, depending on the instructions it gets via the serial port.
|
|
|
|
|
cheers both for your helpful responses. i will soon be getting more into PIC development, and i have a PIC programmer coming soon, so i may be able to figure out UART if i need it.
thanks for now,
surgeproof.
-------------------------------------------------------
ithium is the best.
'Science without religion is lame, religion without science is blind.' --Albert Einstein
'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
|
|
|
|
|
Hello,
If I want to manage all unhandled exceptions myself, do I have to subscribe to both the AppDomain.CurrentDomain.UnhandledException and Application.ThreadException events or would it be enough to just subscribe to the Application.ThreadException event?
Does the Application.ThreadException event handle all unhandled exceptions or does the UnhandledException event of the CurrentDomain handle some?
Thanx for the clarification
-Flack
|
|
|
|
|
They both allow you to handle unhandled exceptions, but handling the Application.ThreadException gives you a good chance to make sure your application remains stable. Unhandled exceptions that affect the message pump are potentially dangerous. For example, unhandled exceptions in certain places (like when a form is loading) will cause the 'X' button in your window to stop responding, along with others errors you might not notice right away.
Of course, if you're not using Windows Forms (say, a Console application) then handle the AppDomain.UnhandledException event.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I cannot figure out where this problem comes from, so I'm looking for suggestions. In my windows app I have multiple MDIs open as well as a panel on the MDI Parent. This panel contains buttons that get disabled ( btn01.Enable = false; ) programmatically when another button is clicked.
I can reproduce this every time:
1. The buttons and labels on this "parent" panel are enabled and populated respectively from the OnMDIChildActivate() event.
2. When a button is clicked, another button is disabled. Due to that last event the active MDI child changes to the first one opened rather than to continue with the code in the function being processed (the onClick event handler).
Note: There is no event handler for the "disable button" event.
Note: The OnMDIChildActivate() event takes a DataSet from the MDI Child which it uses to populate the panel.
Any suggestions?
Thanks,
Remus
|
|
|
|
|
Hi,
A couple fo questions -
+ Is the button that is being disabled on the active form or another form?
+ Also you say the code jumps out of the OnClick handler, did you mean focus only but code executes fine.
You might have to take the long way - write a diable event that returns focus to the 'current' mdi form window.
|
|
|
|
|
Hello,
"+ Is the button that is being disabled on the active form or another form?"
A: The button is found on the same panel in the MDIParent as the button that is being clicked when it is disabled.
"+ Also you say the code jumps out of the onclick handler, did you mean focus only but code executes fine."
A: The code after the ( Button.Enable = false; ) line is not executed - I found out through MessageBox.Show() that it is the last line executed, after which the focus shifts to another form and the OnMDIChildActivate() code is executed. And, I might add, there is plenty of code after that last line...
I'm thinking that to find the 'current' mdi form window may take lots of work for every button event and such. I'm thinking more along the lines of having to create a custom button out of images as it doesn't seem to have the "jumping focus" for anything but the buttons.
More suggestions are welcome - and no matter what I do for a solution, I would still like to find an explanation...
Remus
|
|
|
|
|
I've not been able to trap this event in my WndProc override on my form. I did a search for this problem on this message board and saw two similar responses, anybody know anything about this ?
|
|
|
|
|
The WM_NCLBUTTONUP message is only generated on the extreme edge of a client window.
You could try using the WM_LBUTTONUP message instead and checking to see if the mouse position is outside the client area to get the same effect.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It appears that the WM_LBUTTONUP or WM_LBUTTONDOWN messages are not generated until you click in the client area of the form. In other words if I launch my Form and the first place I click is in the control bar (Nonclient Area) at the top of the Form no messages are raised. However, if I click in the Client area first, then the messages are raised no matter where the click event occurs....
Any other ideas ?
I tried this.Focus() in my Form_Load handle, just incase the Form needed to have focus first, but same results.
|
|
|
|
|
I don't have any other ideas...
This appears to be something that Microsoft screwed up the documentation on.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all,
I have a ColumnChanging event attached to a dataset to perform validations. For some reason unknown to me, the event does not get fired when the user presses the 'tab' key with a null cell.
I am trying to make sure that no cell is null. When no value is entered in a cell, and the column is changed, I want the ColumnChanging event to capture it and throw a messagebox to the user. Please help.
Here is what I have -->
private void Division_ColumnChanging(object sender, System.Data.DataColumnChangeEventArgs e)
{
...
..
.
if ( (e.Column.ColumnName.Equals("Div_Code")) ||
(e.Column.ColumnName.Equals("Div_Name")) )
{
if(e.ProposedValue.ToString().Length == 0)
{
MessageBox.Show("Column " + cs.HeaderText + " cannot be null.", "SPIRIT2 - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
dataGrid1.CurrentCell = (DataGridCell) sender;
}
}
...
..
.
}
|
|
|
|
|
Hi,
Typically in the empty column of a table, the value "(null)" is entered by default(for a data grid atleast) and that is probably why the null case is not being detected. You will probably need to put in a break point to see if the value being returned is indeeed "NULL" instead of "" like you expect. I haven't tested this myslef so I could be way off.
Hope this helps.
|
|
|
|
|
i have a project all developed with technology smartclient(webservices).Need to know as I make to know in the machine customer the application he is being had access through a LAN(Intranet) for example or is being had access the application saw WAN(Internet) it are of the LAn?
|
|
|
|
|
I really couldn't make heads or tails of what you wrote. I'm guessing that you want to know if your WebService can determine if a call came from the local network or Intranet (inside a corporate network) or from out the corporate network?
The short answer is no. The only thing you could do is take the IP address of the request and mask it with the WebServer's subnet mask and compare it to the network address of the WebServer. This will only tell you in the request came from the EXACT SAME SUBNET as the WebServer, otherwise, it's a request that came from over a router and is considered over the WAN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is my question.
Not sure how to ask this really.
I have had very bad luck passing values between forms.
If I open a form and pass a value that works fine. But If I have to pass
some values back to a "Parent" form it does not work so well.
The only way that I have found to do this is using the registry.
Write values to the registry then from the parent window close the form
and read the values that were set.
Is there a better way to return a value from a form?
Thanks
Will
|
|
|
|
|
You can use public members as a starting point.
public class MyForm : Form
{
public int MyTestInt;
}
public int MyMethodInAnotherForm()
{
int returnValue = 0;
MyForm dlg = new MyForm();
dlg.MyTestInt = 0;
if (dlg.ShowDialog() == DialogResult.Ok)
{
returnValue = dlg.MyTestInt;
}
dlg.Dispose();
return returnValue;
}
|
|
|
|