07-11-20, 11:33 PM
(07-11-20, 10:00 PM)ميدو الفنان كتب : السلام عليكم
لدي كود لاخذ سكرين للفورم بس بيبقا فيه فيديو شغال الشاشة بتبقا سوداء فانا عاوز اخد سكرين للفورم والفيديو اللى شغال يظهر
ده الكود
كود :
Dim bmp As New Bitmap(Me.Width, Me.Height)
Me.DrawToBitmap(bmp, New Rectangle(0, 0, Me.Width, Me.Height))
bmp.Save(My.Computer.FileSystem.SpecialDirectories.Desktop & "\" & Me.Text & ".png", Imaging.ImageFormat.Png)
و عليكم السلام
كود :
Private Function CreateScreenshot(ByVal Control As Control) As Bitmap
Dim Screenshot As New Bitmap(Control.Width, Control.Height)
Control.DrawToBitmap(Screenshot, New Rectangle(0, 0, Control.Width, Control.Height))
Return Screenshot
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Capt As Bitmap
Capt = CreateScreenshot(Me)
Capt.Save("E:\trakktour.png", System.Drawing.Imaging.ImageFormat.Png)
MsgBox("Saved Images")
End Sub