Screenshot von panel

  • VB.NET

Es gibt 6 Antworten in diesem Thema. Der letzte Beitrag () ist von Schamash.

    am einfachsten mit dem Snippingtool von Microsoft.
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    @Toni03 Ich denke, Du meinst so was:

    VB.NET-Quellcode

    1. Using bmp As New Bitmap(Panel1.Width, Panel1.Height)
    2. Panel1.DrawToBitmap(bmp, New Rectangle(0, 0, Panel1.Width, Panel1.Height))
    3. bmp.Save("c:\Temp\test.png", Imaging.ImageFormat.Png)
    4. End Using

    Falls Du diesen Code kopierst, achte auf die C&P-Bremse.
    Jede einzelne Zeile Deines Programms, die Du nicht explizit getestet hast, ist falsch :!:
    Ein guter .NET-Snippetkonverter (der ist verfügbar).
    Programmierfragen über PN / Konversation werden ignoriert!
    :) achso :)

    VB.NET-Quellcode

    1. Imports System.Drawing
    2. Public Class Form1
    3. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4. 'Bild definieren
    5. Dim ScreenShot As New Bitmap(100, 100)
    6. Using graph As Graphics = Graphics.FromImage(ScreenShot)
    7. 'Bild vom oberen linken rand machen (hier musst du die Position deines Panels einbinden)
    8. graph.CopyFromScreen(0, 0, 0, 0, ScreenShot.Size)
    9. End Using
    10. 'Bild in einer Picturebox anzeigen
    11. pbTest.Image = ScreenShot
    12. End Sub
    13. End Class


    oder du machst es wie Rod schreibt :)
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."
    Das von RodFromGermany macht explizit ein Bild von deinem Panel.
    Mit meinem Kannst du von einem Beliebigen Bereich des Bildschirms ein Bild machen
    There is no CLOUD - just other people's computers

    Q: Why do JAVA developers wear glasses?
    A: Because they can't C#

    Daily prayer:
    "Dear Lord, grand me the strength not to kill any stupid people today and please grant me the ability to punch them in the face over standard TCP/IP."