08-11-20, 12:08 AM
(07-11-20, 11:53 PM)trakktour كتب :(07-11-20, 11:38 PM)ميدو الفنان كتب :تفضل(07-11-20, 11:33 PM)trakktour كتب :(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
للاسف مشغل vlc لا يظهر وتظهر شاشة سوداء
جربت الكود و شغال
كود :
Dim graphic As Graphics = Nothing
Dim location As Point = Me.Bounds.Location
Dim width As Integer = Me.Bounds.Width + 8
Dim bounds As Rectangle = Me.Bounds
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(width, bounds.Height + 8)
graphic = Graphics.FromImage(bitmap)
Dim x As Integer = location.X
Dim y As Integer = location.Y
graphic.CopyFromScreen(x - 5, y - 5, 0, 0, bitmap.Size)
bitmap.Save("E:\trakktour.png", Imaging.ImageFormat.Jpeg)
MsgBox("Saved Images")
شكرا لك جدا والله انك مبدع
