Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/02/2012, 16:26
Avatar de juanito1712
juanito1712
 
Fecha de Ingreso: mayo-2010
Ubicación: Valencia
Mensajes: 1.124
Antigüedad: 14 años, 9 meses
Puntos: 66
Timer "acaparaRAM"

Estoy en medio de un prorgamita y en el tengo un timer que es tal que asi


Código:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If IsWindowVisible(GetForegroundWindow()) And statuswindow = False Then
            Dim rct As RECT
            Dim victima As Long = GetForegroundWindow()
            GetWindowRect(GetForegroundWindow(), rct)

            Dim bmpScreenshot As Bitmap = New Bitmap(rct.Right - rct.Left, rct.Bottom - rct.Top, PixelFormat.Format24bppRgb)
            Dim gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)
            gfxScreenshot.CopyFromScreen(rct.Left, rct.Top, 0, 0, New Size(rct.Right - rct.Left, rct.Bottom - rct.Top), CopyPixelOperation.SourceCopy)


            Try
                bmpScreenshot.Save(sTempFolderPath & victima & ".png")
            Catch ex As Exception

            End Try



        End If

    End Sub
y el tio no hace mas que acaparar mas y mas ram a cada ciclo que es ejecutado y cuando el asunto empieza a ser mosquenate el solito se vacia y vuelve a ir subiendo

veis algo que pueda hacer para que no esté ahi subiendo y bajando la ram?

Última edición por juanito1712; 02/02/2012 a las 16:50