|
A free, non-interop version can be found here[^], but I don't think that it'll be faster. Another alternative is described in this[^] CodeProject article, using XSL. Third alternative comes from Microsoft and uses WPF[^].
If these three do not fit, then you could search for a webservice that offers this functionality; again, that's a slower option, as it means one has to transmit the data before on can transform it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Greetings,
I am looking for a way to transform, and in particular rotate, the entire picturebox and not just the image inside of it.
Ig you add a picture to a Word or Excel document the picture is inserted and has grips around it and a rotate handle at the top.
How can I replicate this in a c# windows form?
Thanks,
Ron Wensley
|
|
|
|
|
Rotating the image is quite easy.
Rotating the PictureBox control is a huge pain in the ass. Chances are REALLY good you don't even need the PictureBox control at all.
Stuff like this is easily done in WPF. Not very easy in WinForms.
|
|
|
|
|
Dave...I see that rotate controls in WPF is very easy. My problem is that I am way down the road in the WinForm app and it uses several custom controls that are not compatible with WPF.
|
|
|
|
|
You're better off skipping the PictureBox and just painting on the surface that's holding your stuff.
The reason being is you'd have to paint the PictureBox yourself anyway to get it to rotate, so skip it and just paint the rotated image.
The underlying Windows controls don't support being rotated.
|
|
|
|
|
I'm trying to capture the output of a Dell executable command, racadm.exe. I can go to the cmd prompt and type in "racadm.exe getsysinfo" and get an output, but when I try to do this programmatically, it is not working. I can also programmatically use the code block below to get a directory listing, but with this specific exe, I cannot capture the standardoutput.
Any ideas on what I'm doing wrong?
System.Diagnostics.Process si = new System.Diagnostics.Process();
si.StartInfo.WorkingDirectory = "c:\\";
si.StartInfo.UseShellExecute = false;
si.StartInfo.FileName = "cmd.exe";
si.StartInfo.Arguments = "/c" + " racadm.exe" + " getsysinfo";
si.StartInfo.CreateNoWindow = true;
si.StartInfo.RedirectStandardInput = true;
si.StartInfo.RedirectStandardOutput = true;
si.StartInfo.RedirectStandardError = true;
si.Start();
string output = si.StandardOutput.ReadToEnd();
si.Close();
MessageBox.Show(output);
|
|
|
|
|
Try executing the process directly, rather than piping it through the command prompt.
si.StartInfo.FileName = "racadm.exe";
si.StartInfo.Arguments = "getsysinfo";
Also, you might want to wait for the process to exit before closing it:
si.Start();
si.WaitForExit();
string output = si.StandardOutput.ReadToEnd();
si.Close();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi, thanks for the reply.
I tried your suggestions and string output is empty, just as it is with the first code block?
Have you any other ideas?
|
|
|
|
|
Try using the full path to racadm.exe , rather than leaving cmd to find it.
|
|
|
|
|
Hi, I have tried the full path as well as relying on the environment variable as I did in my example, either way string output is blank?
Thanks for replying, have you any other ideas?
|
|
|
|
|
turbosupramk3 wrote: have you any other ideas? No, but having had a quick look at the documentation I suspect this may not work, owing to the type of program it is. You may need to talk to Dell about it.
|
|
|
|
|
turbosupramk3 wrote: I'm trying to capture the output of a Dell executable command The most simple way is to redirect the output to a file. From a console;
C:\> racadm getsysinfo > "C:\myoutput.txt"
turbosupramk3 wrote: // this works below The only difference between the code-blocks are the arguments you're passing. Means that the redirect works, and that something else is wrong.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Agreed, which is why I posted the topic.
I tried:
racadm getsysinfo > "C:\myoutput.txt"
in the command prompt and produced an empty text file. I think it is the way racadm is written, I'm just trying to get help to figure out a work around?
Thanks for replying.
|
|
|
|
|
turbosupramk3 wrote: Agreed, which is why I posted the topic. That means that the code is correct. Changing it will not help.
turbosupramk3 wrote: in the command prompt and produced an empty text file. That means that there was no output. The code is not only correct, it is showing the correct result.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There is an output, I just don't believe that the racadm output method is the same as the dir command which I why I was trying to figure out a work around and referenced that the exe might have not been written well.
I don't have the output here at home, but in the command window it will output parameters and values or it will output an error, it does not return empty in the command window.
If the command window can receive an output, so can my code, I'm just not sure how to catch it.
|
|
|
|
|
turbosupramk3 wrote: There is an output The computer proved that nothing is written to stdout. The command on the console does what you're trying to do from code, and the results will be the same.
turbosupramk3 wrote: I don't have the output here at home, but in the command window it will output parameters and values or it will output an error, it does not return empty in the command window. Instead of reading "StandardOutput", try reading from "StandardError".
turbosupramk3 wrote: the exe might have not been written well. Writing things to stdout is something that's shown in each Hello-World example. It's default behaviour that's hard to change.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Try reading stderr as well as (or instead of) stdout.
|
|
|
|
|
Hi Bob,
I did try that and still received an empty output
|
|
|
|
|
I want divide the data of my datagrid in pages. For example I have 30 rows I would have 3 pages of 10 rows then have 2 buttons, one for "next page" and one for "previous page".
|
|
|
|
|
Im have little or no experience with WPF but this is something that I got from Googling
Paging in Datagrid WPF[^]
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Why? All that does is make it restrictive, and prevents the user from adjusting the view to their requirements. One of the major issues with Windows applications is that the user should be able to adjust the sizes to their own preference.
|
|
|
|
|
There are a few ways to accomplish this. The most obvious way is via using a CollectionView and filtering the pages based on their ordinals. This is pretty straightforward to do and shouldn't take you much work. An alternative approach would be to have a boolean visibility property on your data and use this to update the visibility of the data on the grid by using a BooleanToVisibilityConverter and collapsing the rows that shouldn't be visible. I've known people take this second approach because of a perceived performance impact with the CollectionView approach.
BTW - you should really have asked this in the WPF forum here on CP, rather than here.
|
|
|
|
|
Thanks for the answers but someone can write me the code?
|
|
|
|
|
You've been given the keywords to search on. If you use those keywords, there are numerous examples that show exactly how to do this on the web.
|
|
|
|
|