Click here to Skip to main content
15,915,600 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regarding Windows Service in C# [modified] Pin
Le centriste9-Jun-06 4:42
Le centriste9-Jun-06 4:42 
QuestionEditing ListViewSubItem in C# Pin
peshawarcoder8-Jun-06 23:59
peshawarcoder8-Jun-06 23:59 
AnswerRe: Editing ListViewSubItem in C# Pin
Corinna John9-Jun-06 1:46
Corinna John9-Jun-06 1:46 
QuestionSqlCommand.parameterCollection ?? Pin
maaran8-Jun-06 23:54
maaran8-Jun-06 23:54 
AnswerRe: SqlCommand.parameterCollection ?? Pin
Colin Angus Mackay9-Jun-06 0:04
Colin Angus Mackay9-Jun-06 0:04 
GeneralRe: SqlCommand.parameterCollection ?? Pin
maaran9-Jun-06 0:27
maaran9-Jun-06 0:27 
GeneralRe: SqlCommand.parameterCollection ?? Pin
Guffa9-Jun-06 3:02
Guffa9-Jun-06 3:02 
QuestionDecreasing CPU usage Pin
Shy Agam8-Jun-06 23:42
Shy Agam8-Jun-06 23:42 
I wrote a class named Region, which encapsulates the content of a part of the screen.
Region keeps two Bitmap objects: content, and lastContent,
and it compares them via this code:
private void checkForChange()
{
    for (int y = 0; y < bounds.Height; y += 10)
        for (int x = 0; x < bounds.Width; x += 10)
            if (content.GetPixel(x, y) != lastContent.GetPixel(x, y))
            {
                userCallBack(this);
                return;
            }
}
In the main program, I have an array of Region object, each representing a different part of the screen.
I use a new thread for each region check, and when a check is finished, I reactivate it.

However, this consumes a great deal of CPU.
Task Manager shows between 15 to 25 CPU usage.

Any ideas regarding how to decrease the CPU usage (not at the algorithm level)?

Thanks,
Shy.
AnswerRe: Decreasing CPU usage Pin
Robert Rohde8-Jun-06 23:46
Robert Rohde8-Jun-06 23:46 
GeneralRe: Decreasing CPU usage Pin
Shy Agam8-Jun-06 23:52
Shy Agam8-Jun-06 23:52 
AnswerRe: Decreasing CPU usage Pin
Shy Agam9-Jun-06 23:28
Shy Agam9-Jun-06 23:28 
QuestionHow to Disable Tab inTabControl using .NET 2.0 [modified] Pin
VenkataRamana.Gali8-Jun-06 23:30
VenkataRamana.Gali8-Jun-06 23:30 
AnswerRe: How to Disable Tab inTabControl using .NET 2.0 [modified] Pin
sathish s8-Jun-06 23:46
sathish s8-Jun-06 23:46 
QuestionTab Control Button Pin
Mairaaj Khan9-Jun-06 3:08
professionalMairaaj Khan9-Jun-06 3:08 
AnswerRe: Tab Control Button Pin
Drew McGhie9-Jun-06 8:41
Drew McGhie9-Jun-06 8:41 
Questionediting a ListViewSubItem in C# Pin
peshawarcoder8-Jun-06 23:27
peshawarcoder8-Jun-06 23:27 
AnswerRe: editing a ListViewSubItem in C# Pin
Ed.Poore9-Jun-06 4:59
Ed.Poore9-Jun-06 4:59 
AnswerRe: How to change website fonts with different fornts? Pin
J4amieC8-Jun-06 22:49
J4amieC8-Jun-06 22:49 
Questionrealizing a URL using Regular Expressions Pin
Rizwan Rathore8-Jun-06 22:25
Rizwan Rathore8-Jun-06 22:25 
AnswerRe: realizing a URL using Regular Expressions Pin
Ed.Poore8-Jun-06 22:30
Ed.Poore8-Jun-06 22:30 
GeneralRe: realizing a URL using Regular Expressions Pin
Rizwan Rathore9-Jun-06 4:26
Rizwan Rathore9-Jun-06 4:26 
GeneralRe: realizing a URL using Regular Expressions Pin
Ed.Poore9-Jun-06 4:57
Ed.Poore9-Jun-06 4:57 
GeneralRe: realizing a URL using Regular Expressions [modified] Pin
Rizwan Rathore9-Jun-06 7:56
Rizwan Rathore9-Jun-06 7:56 
GeneralRe: realizing a URL using Regular Expressions Pin
Ed.Poore9-Jun-06 10:06
Ed.Poore9-Jun-06 10:06 
GeneralRe: realizing a URL using Regular Expressions Pin
Rizwan Rathore9-Jun-06 22:04
Rizwan Rathore9-Jun-06 22:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.