|
snouto wrote:
how are you collegues in net i am really in dangerous and seriously problem alright i just want to retrieve the instant webcam stream into the corresponding images to transform it through the network any body knows how
The full stop is on the bottom right of the keyboard, just two to the left of the shift key.
snouto wrote:
Miss With The Best And Die Like The Rest
ROTFL - you mis-spelled your sig block ? Or do you really mean miss and not mess ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
snouto wrote:
i am really in dangerous and seriously problem
First, extricate yourself from your "dangerous" situation, then call us back. It's probably not a good idea to discuss coding issues while you're fighting for your life.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I serialize a class derived from TreeNode ? It seems that somebody did a big mistake when creating this (ond other similar) class(es). It is serializable and has GetObjectData() and suitable constrauctor (taking SerializationInfo and StreamingContext arguments), but they're both declared as private. When I made my custom class deriving from TreeNode and having only one additional data member, and tried to serialize it, without explicitly defining above mentioned functions, an exception was thrown that a constructor for deserializing couldn't be found. But on the other hand, I can't make use of already defined (in base class TreeNode ) functions, because they're private! So what can I do? Write all this serialization from scratch on my own??? It's insane... Help me!:->
|
|
|
|
|
Is my question really so stupid ? Or is it just rethoric (i.e. without answer?);P
|
|
|
|
|
I am working on a graphics intensive project and need some input related to graphics benchmarks. Basically I have an underlying data source that can change multiple times per second. This change is then displayed as close to real-time as possible through a gui (bars, charts, gauges, etc). On one hand, most of the gui widgets exist in the form of user controls that can easily be dropped onto a windows form. On the other hand the data changes so rapidly, would it be more efficient to custom draw all pieces of the data in one image via System.Drawing or DirectX so that in essence only one Paint event was firing at each change.
The second would be more code intensive but is there somewhere that may show what efficiencies this approach could have? Are there any other ways to handle refreshing graphics for rapidly changing data values?
Thanks in advance.
gkotrick
|
|
|
|
|
If your data is changing that often, do you really need to refresh every time ? How much will your users suffer if the update is 1 1/2 seconds out of date ( refresh every two seconds ) ?
As for your question, drawing everything onto one internal bitmap that you then draw to the screen is definately going to be a lot more efficient. Personally, I'd lean towards writing it so that at a given interval, it redraws the entire image, THEN invalidates the screen so it is redrawn. Then it will draw as often as it is able to (note this will max out your processor, because you're asking it to go as fast as it physically can - this also means you need to use a threaded model so that your UI remains responsive ), assuming this is less often than the data is refreshed.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks for the reply. Yes this will be a threaded model and refreshing every 2 seconds will work depending on the type of widget being painted. For example a strip chart would show the entire data series but a level bar would only show the most recent. I guess I'm looking for a balance (or breaking point) between end user experience and system resource. I certainly do not want to cause a meltdown on someones CPU but at the same time I do not want data being missed because it was not displayed.
gkotrick
|
|
|
|
|
Why don't you cache values, and then display them all every two seconds ? Surely if you only show the most recent value and it's changed more than once in two seconds, that data is insignificant ?
Anyhow, that's what I would do, every two seconds make a copy of the data ( so you can keep collecting at the same time, but your data is an accurate 'snapshot' of a moment in time ) and then drawn to a bitmap, which is drawn to the screen in one go.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I did some searching and found someone that used IE's cache to do this cause the axweb thing supposedly saves there.
But i dont like that approach...any way to extract them from maybe the Document property?
|
|
|
|
|
You can get the images of the document you're on, sure, look at document.images collection.
If you want to get the list of images previously previewed in IE in the past, the only way AFAIK to do this would be to search through the IE cache.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
I tried that way...but that property isn't like a regular collection that i can iterate through. It expects me to know the name and index of where the image is in collection, unless i'm mistaken.
|
|
|
|
|
I need to shutdown explorer programmatically. I had to do this once in a C++ project and I used the following code:
HWND hwndShell = NULL;
hwndShell = FindWindow("Progman", NULL); // Locate the Windows shell
if(hwndShell != NULL)
{
PostMessage(hwndShell, WM_QUIT, 0, 0L)// Tell the Windows shell to quit
}
Any ideas on how to do this in C#?
Thanks!
Ian
|
|
|
|
|
You can do this using the System.Diagnostics namespace. The following code will kill explorer.exe:
Process[] RunningProcesses = Process.GetProcessesByName("explorer");
Process proc = new Process();
foreach(Process p in RunningProcesses)
{
if(p.ProcessName == "explorer")
{
proc = p;
break;
}
}
proc.Kill();
When I tested it however explorer.exe restarted a few seconds after it was killed. This might be due to some program I had running, but I'm not sure.
|
|
|
|
|
Thanks alot! I wonder how you kill it for good? I want to control when it starts up again. Anyone know how to do that?
Thanks!
Ian
|
|
|
|
|
You can't. Explorer automatically restarts itself.
But, I seem to, vaguely(!), remember a policy somewhere that controls this. I can't find it and I can't remember where I saw it, though.
BTW: Why on earth would you want to do this anyway?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Why? It's a long story...
The C++ code in the original post shuts down explorer indefinately. Is the limitation a C# limitation?
|
|
|
|
|
Ian Bowler wrote:
The C++ code in the original post shuts down explorer indefinately. Is the limitation a C# limitation?
This is, I believe, because you sent the process the WM_QUIT message, with Process.Kill() you kill it without sending it the WM_QUIT message.
In order to keep explorer from restarting you could either run a loop on a new thread, which continously checks if explorer has been restarted and kills it again if neccessary (this isn't really the best idea).
Or (and this should be the better idea) you could import the FindWindow and PostMessage methods with DllImport and use them the same way as in C++;
|
|
|
|
|
Thanks! I'll give it a whirl...
-Ian
|
|
|
|
|
I've got time.
Honestly, if an application killed off Explorer for me, without my permission, I'd want to know where on earth this person was who wrote it, for some very not-so-nice reasons...
Please tell me this isn't being deployed into the real world?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I understand your concerns and curiosity. I'm not going to be shutting down explorer all willy-nilly. There's a good reason for it in the context of what I'm working on.
For those of you that may wonder how this all turned out, I had to import the User32.dll functions, FindWindow and PostMessage (as tommazzo suggested). The final code looks like this:
public class Win32
{
public Win32(){}
[DllImport("User32.dll")]
private static extern IntPtr FindWindow(string ClassName,
string WindowName);
[DllImport("User32.dll")]
private static extern Boolean PostMessage(IntPtr hWnd,
uint Msg,
IntPtr wParam,
IntPtr lParam);
public bool ShutdownExplorer()
{
Boolean bSuccess = false;
IntPtr Handle = new IntPtr(0);
// Get a handle to explorer.exe
Handle = FindWindow("Progman", null);
// Shutdown explorer.exe
if(Handle != IntPtr.Zero) bSuccess = PostMessage(Handle,
0x0012,
IntPtr.Zero,
Ptr.Zero);
return bSuccess;
}
}
Thanks tommazzo for the solution. Thanks Dave for your insights.
Regards,
Ian
|
|
|
|
|
tommazzo wrote:
When I tested it however explorer.exe restarted a few seconds after it was killed.
It's supposed to do this. By default, Explorer automatically restarts itself if it's shutdown without a user session logoff. Sometimes, though, it doesn't restart itself. When this happens, you can still hit Ctrl-Alt-Del, start the Task Manager, click on File/New Task (Run), then type CMD in the prompt, NOT EXPLORER! Instead, type CMD and in the resulting command window, type START EXPLORER.
For some reason, if Explorer crashes and you type EXPLORER in the Start/Run box, it won't restart. Though, typing the START EXPLORER command in a CMD window works. Wierd...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am writing a frontend to the ffmpeg program so I can convert multimedia files to a Playstation Portable format. I am using the Process Class with redirected outout so I don't have a console window popup. Now if I run the Program Through the IDE (Debug or Release) it works flawlessly. If I run the generated exe outside of the IDE I get errors from the program and the conversion does not complete or even do anything wright. I know this could be a ffmpeg issue but the only difference from working and not working is the IDE execution. I have checked the environment variables and there is only one difference a debug varibale is set in the IDE and I have artificaly set that just to see if that would work and it didn't.
Any Ideas?
Thanks
Cyber
|
|
|
|
|
There's more than just the IDE being there or not, the current directory also changes. So, I have a couple questions...
Does your application supply the full paths or all the files involved with ffmpeg? Does your code consider than ffmpeg might fail and log everything that came out of the session into a file somewhere? What errors are returned by ffmpeg when you shellexecute it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is my Code:
Process P2 = new Process();
P2.StartInfo.UseShellExecute = false;
P2.StartInfo.FileName = Environment.CurrentDirectory + @"\ffmpeg.exe";
P2.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
P2.StartInfo.RedirectStandardOutput = true;
P2.StartInfo.RedirectStandardError = true;
P2.StartInfo.Arguments = strCmd;
P2.StartInfo.CreateNoWindow = true;
P2.Start();
There is not exit code like info the program just can't read the input files correctly. I do have all the files in the Environment.CurrentDirectory and have even at one point appended the Environment.CurrentDirectory to the Environment Variable "PATH" statement.
Also if I allow the console box to appear with the redirect turned off. It works on both situations.
Thanks,
Cyber
|
|
|
|
|
I didn't ask for an exit code. I asked if you were reading the redirected output and dumping it into a file for later review. If the program can't read the files, or any other error ffmpeg complains about, it would be displayed in either one of the streams. If you were reading those streams, then the output could be dumped into a file for debugging.
Now, since your doing this to prevent a console window from showing up, it's entirely possible that ffmpeg doesn't support that. It might actually need a console window because the app is trying to write directly to the screen buffer in that window. If there is no console window, no screen buffer. No screen buffer, BOOM!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|