|
JPEG2000 claims to support lossless compression, but GDI+ does not support it yet in any release bits. If one could find a GDI+ image codec then .NET would inherit the format by instantiating your own ImageFormat using whatever Guid defined with such a codec.
To the original poster, if you want lossless compression PNG is about as close as you'll get.
You can also control the amount of compression (less compression == better quality == larger file size) by using the Save override to specify an EncoderParameters object and using the EncoderValue enumeration with one of the compression members if you save as a TIFF image (.tif or .tiff).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
hi every 1 ,
i'm working on a simple networking project and i want to transfer files between the client and the server , i use a FileStram and StreamReader in the client to read the data from that file . but i think i no data are retreved from thet file . is there any way to do that correctly ?! can any 1 write a few lines to show me how to get this byts and send them thrugh the network ?
please help me !
|
|
|
|
|
You need to use a NetworkStream , which is documented in the .NET Framework SDK class library[^].
You can obtain a NetworkStream from using a TcpClient or a plain Socket connection. You can also obtain one from WebResponse.GetResponseStream . Pluggable protocol handlers that extend WebRequest and WebResponse like the HttpWebRequest and HttpWebResponse class, respectively, communicate across channels (like HTTP for the HttpWebRequest class, obviously) and allow you to stream both request and response data.
Look at the classes available in the System.Net and System.Net.Sockets namespaces in the .NET Framework, which I've linked above and is installed by default with VS.NET. It's also available as a separate download from http://msdn.microsoft.com/netframework[^].
If all you need to do is copy a file from a network share you can use File.Copy . If the user has permissions the file will copy across the network to the destination location just like how files are copied when using Windows. If the user does not have permissions and you need to impersonate a use who does (which requires that you prompt for credentials), then read about the WindowsIdentity.Impersonate[^] method.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have a table that I require calculations to be performed against.
To achieve this, I have written several methods for the required functions.
I have no problem with this solution although it does appear limited.
As an example, I have created a form which is passed the DataTable. The form allows the user to choose the required function EG Divide, Mltiple, Add or Subtract and then asks what value/column the function should be performed against, what factor value/column should be used in the calculation and finally, asks where the result should be stored.
Now if the user wants to Divide the value in columnA by the value in columnB and store the result somewhere, it all works fine.
But imagine if the user wants to perform a further calculation on the result, at present the result has to be stored somewhere else and a second pass performed using the desired function.
The only way I have though about solving this problem is to create some kind of math object which can be lnked in a daisy-chain or stored in an array so that multiple calculations can be performed therfore creating an equation.
Has anyone had any experience of doing this or similar?
Any ideas on removing the restrictions of the curent design?
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
Using a DataTable is rather inefficient with lots of overhead you don't need for a simple state machine and what could be done using simple state variables. Store your result in a variable just like you do for your controls you dropped onto the form in the designer. Read the operands from the form, calculate, and store the result in the variable. If you want to remember all the results use a growable list like ArrayList or Stack . A stack is what your more advanced calculators use to store previous results, and stacks are what are typically used by calculators to evaluate expressions. You can find lots of information on the web about evaluating expressions to perform calculations.
Even if you want to stick with using a DataTable add a column for metadata about the operands and/or operators you have stored in the DataRow s. You could, for example, push the result of a calculation into a new DataRow with information that states whether the data is an operand, operator, or result.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I am currently designing a solution for a school to maintain schedules and other stuff online. I want to use windows security for the users.
How can I ask for the windows login data in a windows forms application (to provides credentials for the server)? This because they use Novell, and the server will be on a separate domain with it's own users.
WM.
What about weapons of mass-construction?
|
|
|
|
|
|
Looks great until now.
My next question is: Does the DPAPI also work on win 98?
WM.
What about weapons of mass-construction?
|
|
|
|
|
If you look-up the native APIs that are P/Invoked in the sample code in the MSDN Library[^] like CryptProtectData[^] you'll see that DPAPI isn't, but LogonUser is. Again, though, make sure that you never store nor transmit the password in clear text. LogonUser can authenticate (with or without returning a security token, which you don't need if all you need to do is authenticate the user and not authorize any secure contexts) and will encrypt the data before transmitting it, so run it locally.
If you must support Windows (as opposed to Windows NT, on which NT4, 2000, XP, 2003, and all newer Windows platforms are based) then you'll find that your application will be very limited in terms of security and cryptographic APIs.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have to support windows 98 since that's the OS the clients will be running on. It would be better to say: Use windows XP or else you are soooo screwed. But yeah, customers ...
Anyway, the solution works perfectly
So thanks for the help.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I am looking to allow the user to move a control on the screen by clicking and dragging a control and then releasing the mouse. Much like a desktop shortcut. My control will be a usercontrol and I am unsure of how to understand how to interpret the mouse poisition on screen and on the control along with the mouse event listeners to successfully move the control fluidly around the screen.
Thanks
M4tt
|
|
|
|
|
|
hi all,
i want to create a bar like the horizontal left one that separates the buttons from the rest of the things in the leftmost part in outlook 2003.is it a splitter bar or nething else.normal splitter bar uses shadows while moving but this one doesn't.
thanx in advance..
|
|
|
|
|
This site contains many articles about all sorts of controls. All you need to do is search[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
i was searching for the particular thing for the last few days but unfortunately i haven't found any solution to my query yet.yes you r quite
right to say that this site contains many articles about controls.but my problem is that i'm not sure of the control that is used to create that bar(the bar that separates the buttons panel and the shared calendar in the leftmost part of the application).first i thought it was a splitter bar, but then splitter bar leaves an shadow(or an impression of itself) while moving while the bar that i mentioned in outlook 2003 doesn't.if i am wrong at ne point do correct me.
just.starting..
|
|
|
|
|
When you say "Outlook splitter" how am I supposed to know that you mean the splitter that is implemented by Windows. It's not specific to Outlook, though Outlook's implementation of the splitter draws while resizing. The default does not.
To use the splitter, you dock a control to one side, then dock the splitter to the same side, then dock another control to all sides (fill). It must be done in that order or you'll have to change the generated code manually to fix it. It will draw a frame as you move it then resize the docked controls after you release the mouse. Outlook works the same way because it uses the same splitter (the splitter is actually a native Windows Common Control that Windows Forms encapsulates).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
In Visula Studio Help....Search for "Multipane User Interface"...There is a very nice article entitled "Walkthrough: Creating a Multipane User Interface with Windows Forms".....this seems like what you are after.
Cheers
Craig
|
|
|
|
|
hi all,
does anyone knows where i can find a TextBox that is specialized in inputing the IP address in its format, i saw may controls for that purpose so i guess there are already ones that are created and i don't want to recreate them again.
thanks in advance.
Hercules
|
|
|
|
|
You can use the normal textbox but with validation. FYI, I think .NET 2.0 has a masked textbox with validation built in.
Any remotely useful information on my blog will be removed immediately. There are 10 kinds of people in the world. Those who have heard of the ubiquitous, overused, worn-out-like-an-old-shoe binary "joke" and those who haven't.
Judah Himango
|
|
|
|
|
I have a opend NetworkStream for Read. If I do Read(buffer, 0, 3) in buffer I have byte[] {49, 13, 10}. But if I create StreamReader to read from NetworkStream function ReadLine awlays return null. All examples that I look at using ReadLine from StreamReader. What can I do? Is it posible because my NetworkStream is opend from Socket not from TcpClient.GetStream()?
And one more question: Because my socket will be opend permanently, how can I implement waiting until data was recieved, using the model above?
|
|
|
|
|
It doesn't matter where the stream comes from, as long as it represents text if you're using a TextReader derivative like StreamReader .
What encoding did you specify? A NetworkStream is a stream of bytes - not characters - and bytes are encoded specificy for different text representations like 7-bit ASCII or 8-bit ASCII with a codepage (ANSI) for a specific system. There's also UTF8 and Unicode, where Unicode is 2 or 4 bytes per character. .NET stores and treats characters internally as UCS-2 (2-byte Unicode).
Also keep in mind that when you read from a stream the cursor (stream position) is advanced so you cannot read that data again from a non-seekable stream (like a NetworkStream , since bytes are being transferred across the net). If you need a non-seekable stream to be seekable you need to cache the data and read-in the cached data, using that to read and seek in the stream.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I want how to fire shortcut keys programatically. How can I make an action for some button event to fire any keyboard shortcut. Let me give you an example:
Suppose we have some button with caption "Button1" that button has a function for his click event called "button1_click", that function should contain the code that I asking for. That code should fire the required keyboard shortcut like (CTRL+C, CTRL+V, CTRL+S,...).
So, if any can help please send me. Summary for what I need is to fire shortcut keys though code programming.
Another point. How can I get the selected text in an opened browser (InternetExplorer) programatically from another application?
Thank You
egyseiko
|
|
|
|
|
For first question you can use:
System.Windows.Forms.SendKeys.Send("^C");
System.Windows.Forms.SendKeys.Send("^V");
System.Windows.Forms.SendKeys.Send("^S");
|
|
|
|
|
I executed that comman for CTRL+C "System.Windows.Forms.SendKeys.Send("^C");" to make copy while I'm selecting some textbox text as for test. Then make paste using CTRL+V but it didn't give me the result for the textbox text. Is that means it didn't fire CTRL+C using "System.Windows.Forms.SendKeys.Send("^C");"
egyseiko
|
|
|
|
|
This code works for me:
copytextbox.Focus();
SendKeys.SendWait("^c");
pastetextbox.Focus();
SendKeys.SendWait("^v");
So , use SendWait() instead of Send() and focus on the control you want before sending shortcut keys.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|