منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
تعديل على كود take ScreenShot - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : تعديل على كود take ScreenShot (/showthread.php?tid=7159)



تعديل على كود take ScreenShot - W XP 2003 - 27-11-12

انا عندي أداة SplitContainer1 و اداة SplitContainer1.planel2
دخلها AxWindowsMediaPlayer1
في اريد التعديل كود بدل ان يصور شاشه كامله , اريد ان يصور داخل اداه SplitContainer1.planel2 ما عرض فيها يعرض فيها AxWindowsMediaPlayer1 اي ان سوف يصور مايعمل داخل اداه AxWindowsMediaPlayer1 ,, مع مرعات تغير في حجم الفورم , هل ممكن ذلك ؟
كود :
Imports System.Drawing.Graphics

Dim path As String = String.Empty


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim saveFile As String = path & ".jpg"

        Dim screenSize As New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)

        Dim capImage As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)

        Dim graph As Graphics = Graphics.FromImage(capImage)

        graph.CopyFromScreen(New Point(0, 0), New Point(0, 0), screenSize)

        capImage.Save(saveFile)

        MsgBox("Saved File To : " & saveFile) 'Showing the whole path where capturedImage is saved

        Process.Start(saveFile) 'Showing The Captured Image In Windows Image Viewer
    End Sub



تعديل على كود take ScreenShot - سعود - 27-11-12

ممكن تعديل بسيط للفكرة حيث تستخدم الفورم كاطار تصوير وتلونه بلون تجعله transparentkey


تعديل على كود take ScreenShot - سعود - 27-11-12

او ممكن تستبدل
كود :
My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height
بعرض الاداة وارتفاعها


تعديل على كود take ScreenShot - Aly El-Haddad - 28-11-12

السلام عليكم،
أستبدل كودك بالكود التالي:
كود :
Dim saveFile As String = path & ".jpg"
        Dim cropSize As Size = AxWindowsMediaPlayer1.Size
        Dim croppedImage As New Bitmap(AxWindowsMediaPlayer1.Size.Width, AxWindowsMediaPlayer1.Size.Height)
        Dim G As Graphics = Graphics.FromImage(croppedImage)
        G.CopyFromScreen(AxWindowsMediaPlayer1.PointToScreen(Nothing), Nothing, cropSize)
        PictureBox1.Image = croppedImage
        croppedImage.Save(saveFile)
        MsgBox("Saved File To : " & saveFile) 'Showing the whole path where capturedImage is saved
        Process.Start(saveFile) 'Showing The Captured Image In Windows Image Viewer



تعديل على كود take ScreenShot - W XP 2003 - 28-11-12

الله يعطيكم العافية يااخواني كرام
شكرا لك يااخي Aly El-Haddad على كود 100%
الله بيارك وقتك وجميعاااا لكم