0
請參閱下面的代碼。我設法使用VB截取了我的計算,並將其存儲爲位圖。我想將這個位圖(很快!)轉換爲一個rgb值的數組。在VB中將位圖轉換爲RGB
任何簡單的代碼,可以做到這一點?
乾杯 馬丁
' Capture screen code
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.Format32bppRgb)
graph = Graphics.FromImage(screenshot)
graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
' Display the captured image
Display.Image = screenshot
這已經是一個數組。然而你必須用C#編寫代碼,vb.net不支持真正利用LockBits()的指針。 – 2012-02-18 01:28:07