|
|
Okay, I think I understand now. Are you talking about the M-Files Left Pane on the left side of that window in your image, where it displays various options to perform on selected files? If so, I'm sorry but I can't help you with that.
Good luck,
jase
Edit: I just did a half-as*ed search on Google for "Extending Windows Explorer with Custom Panes C#" and found a whole heap of results.
|
|
|
|
|
The main question I have here is how to improve CPU usage... Memory Usage is not an issue
The Client program connects to the server and sends screen shots (at a rate of 250ms) to the server. This all works well, but I need to use less CPU... The server side program is of no concern either
For brevity purposes, I will simply list what's used. First of all, a TcpClient and a NetworkStream are used. BinaryFormatter serialization is also used to de/serialize objects into byte arrays. The conversion of an object to a string is not quite a choice, since I intend to transfer more objects later on (without having to change much code). A timer with interval of 250ms triggers DoWork method of a BackgroundWorker to take and send a screen shot.
The method used to take the screen shot is:
private Image TakeShot()
{
Bitmap bmpScreenShot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graphics grcShotGraphic = Graphics.FromImage(bmpScreenShot);
grcShotGraphic.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
grcShotGraphic.Dispose();
return (Image)bmpScreenShot;
}
I just need to know what's causing such CPU usage and how to improve it. E.g. using Threads instead of BackgroundWorker or a more efficient method to take the screen shot. As I have said, Memory Usage and Network load is of no concern. Furthermore, I know that increasing the interval would result in better performance, but I am looking for something other than that. Current CPU usage ranges between 20-40% on an Intel Core 2 Duo E7300 
|
|
|
|
|
|
Whilst I would like to thank you for taking the time to read and attempt to resolve the problem, that actually made the situation worse. Since on average, CPU usage increased by another 2%.
|
|
|
|
|
Hi,
there is two parts to my answer:
1.
so those five lines of code are executed over and over in some loop. Now which lines do you not really need all the time? I can name three, possibly four, depending on what happens to the resulting bitmap. I guess taking advantage of that would make it less expensive by a factor of I'd say 3.
2.
remote PC access utilities normally do NOT transmit the entire screen over and over; instead the current screen is compared with the previous one, and only the differences are transmitted. That would be a medium-complexity challenge as the .NET image classes don't really support that AFAIK.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thanks about that... I'll check Part 1 you mentioned. However, with regards to Part 2, that would only improve the Server or the network bandwidth, but not the processing, since a lot of time is spent comparing...
However, thanks for taking the time to answer... Please provide me with the possibilities of reducing the lines in the ScreenCapture method. Thanks!
|
|
|
|
|
I have a string. The value of that string contains some english and non english characters.
I have two requirements:
1) Determine whether the string contains non english characters.
2) Remove all the non english characters from the string and get the resultant string which contains only english characters.
How can i do so ?
Imtiaz
|
|
|
|
|
Convert each character into a byte (you can use the convert class), and then check the byte's against the ASCII table.
capital A to Z = 65->90 numeric
lower case A to Z = 97->122 numeric.
You would have to check for other characters you wanted to keep though. (i.e comma's fullstops etc etc).
<br />
string word = "fdffd";<br />
foreach (char c in word)<br />
{<br />
byte b = Convert.ToByte(c);<br />
if ((int)b > 65 && (int)b < 90)<br />
{<br />
}<br />
else if ((int)b < 97 || (int)b > 122)<br />
{<br />
}<br />
else<br />
{<br />
word.Replace(c.ToString(), string.Empty);<br />
}<br />
}<br />
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
MarkBrock wrote: Convert each character into a byte
That seems unnecessary, as does the casting to int.
If you want to do it that way, just use if ( ( c >= 'A' ...
|
|
|
|
|
Your right .
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
Do you want to have only alphabetic characters? Or do you also want digits and symbols too?
|
|
|
|
|
I want digit numbers too.
Imtiaz
|
|
|
|
|
I would check for characters between ' ' (SPACE) and '~' (TILDE).
You may also be able to use a Regular Expression to remove the characters you don't want, but I've never done it that way.
|
|
|
|
|
Hi,
I have been using Crystal report in my web applications till now.
In msvs 2008 I found Microsoft ReportViewer control.
can you tell me how to use it.
Thanks in advance....
Elizabeth...
|
|
|
|
|
hi elizabeth,
refer to this link may be its useful for u,
http://www.c-sharpcorner.com/UploadFile/chauhan_sonu57/SQLReportingServices03032006002905AM/SQLReportingServices.aspx
Thanks & Regards,
Sundar
|
|
|
|
|
How to know the proxy server details, to which the IE is connected to, and how to catch the text before it displays on IE for a specific url?
can we do this using a BHO?
How can I know the proxy details to which IE is connected on my PC?
Can't I get all these things through c# programming at runtime?
How can I know the text/data/header that the IE is getting from Proxy at runtime through c#?
|
|
|
|
|
|
|
Hi,
Can anyone tell me how will I go about checking database connectivity using C#? I have an application that I want to enable users to click on a button and then it will check if the app can connect to the database.
The database is SQL 2005 Express and I am using Visual Studio 2008 with .NET 3.5.
Illegal Operation
|
|
|
|
|
|
When I need to do that I simply connect to the database.
|
|
|
|
|
Hi,
can any one tell me how to run .NET applications in Linux. I know we can do it using Mono develop. I am completely new to linux and want to know the exact process of doing it and the correct download link for mono develop used to run in Linux(Fedora 6)or Red Hat Linux.The requirement is very urgent, otherwise I need to learn java to do it.
|
|
|
|
|
Member 3057887 wrote: The requirement is very urgent
Really?
Member 3057887 wrote: the correct download link for mono develop used to run in Linux(Fedora 6)or Red Hat Linux
try this[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi I'm pretty new to programming in C.
I've found the ribbon code here Ribbon Panel[^] and I can get it to work and modify the ribbon/panel as I want.
(I am fairly new) but what I cannot work out though is how I can get it to open the new window in the lower section. So going off the picture provided with the code at the top of the page say I click on SETTINGS then I want it to display the SETTINGS information below, and then if I click on LOG to display the log information below the ribbon.
What would I need to do to get this as a end result? Even if I can be pointed in the correct direction for what I should be doing would be great.
Thanks heaps in advance
P.S... Great site!
|
|
|
|