Gezielt Pixel färben/zeichen auserhalb..

  • VB.NET

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von vb-checker.

    ja, man kann auf dem Bildschirm zeichnen, allerdings wird das durch jede Aktualisierung, zum Beispiel Verschieben von Fenstern, wegradiert.

    VB.NET-Quellcode

    1. Public Class Form1
    2. Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr
    3. Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal hdc As IntPtr) As IntPtr
    4. Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    5. Dim hdc As IntPtr
    6. hdc = GetDC(IntPtr.Zero)
    7. Try
    8. Dim g As Graphics
    9. g = Graphics.FromHdc(hdc)
    10. Try
    11. g.FillRectangle(Brushes.Red, 10, 10, 100, 100)
    12. Finally
    13. g.Dispose()
    14. End Try
    15. Finally
    16. ReleaseDC(IntPtr.Zero, hdc)
    17. End Try
    18. End Sub
    19. End Class


    http://bytes.com/topic/visual-basic-net/answers/357734-how-can-i-draw-desktop

    Skybird schrieb:

    Das sind ja Ubisoftmethoden hier !