VB VB.NET RAM AIUTO

Stato
Discussione chiusa ad ulteriori risposte.

YITW

Utente Bronze
30 Settembre 2016
22
8
3
34
Ultima modifica:
Ciao a tutti ho un problema con un programma che ho fatto in visual basic .net , il programma cambia 14 immagini al secondo mostrando un video, pero credo che non azzeri lo spazio in ram passo da 100 mb a 3 GB di ram in un minuto come posso risolvere il problema ? ps e si spegne dopo che supera 3gb di ram .
 
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Timer1.Stop()

End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim bounds As Rectangle
Dim screenshot As System.Drawing.Bitmap
Dim graph As Graphics
bounds = Screen.PrimaryScreen.Bounds
screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = screenshot
screenshot.Save("system_ENE_sensore_vista_output_0.png", Imaging.ImageFormat.Png)
Timer1.Stop()
Timer1.Start()

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs)
PictureBox1.Image.Save("1.png", System.Drawing.Imaging.ImageFormat.Bmp)
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Timer1.Start()
End Sub
End Class


questo e il codice il problema e mi da errore alla riga graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy) parametro non valido . mi succede con la risoluzione 1900x1080 ma non con 1300x800
 
Stato
Discussione chiusa ad ulteriori risposte.