System resource Hog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel N

    #1

    System resource Hog

    I am using a timer to capture the screen, and verify certain criteria
    through GetPixel(). The timer is set at 333 (about one third of a second).
    And after running the program, it takes MASSIVE resources and slows the
    computer down. Is there something I can do to prevent this? Here is the code
    I am using:



    I am using a program to capture the screen, and saving it in an image box;



    'Capture Screen

    CaptureScreen()

    ScreenPictureBo x.Image = oBackground



    Then saving the image to a bitmap;



    'Save save image to bitmap


    Dim B As New Bitmap(ScreenPi ctureBox.Image)



    I then GetPixel to determine certain procedures;



    'Clock

    RGB = B.GetPixel(967, 512)

    str = RGB.ToString

    str = str.Substring(7 , str.Length - 8)

    If str = "A=255, R=8, G=8, B=8" Then

    ActionLabel.Tex t = "Clock"

    End If



    'Player 1

    RGB = B.GetPixel(818, 123)

    str = RGB.ToString

    str = str.Substring(7 , str.Length - 8)

    If str = "A=255, R=0, G=0, B=0" Then

    Label18.Text = "Player 1"

    End If



    .. . .


Working...