add Modules.Windows

This commit is contained in:
Jonathan Jenne
2019-09-18 12:09:21 +02:00
parent 8a8b286c77
commit 74527690cd
4 changed files with 233 additions and 16 deletions

27
Windows/Drawing.vb Normal file
View File

@@ -0,0 +1,27 @@
Imports System.Drawing
Imports DigitalData.Modules.Logging
Public Class Drawing
Private _Logger As Logger
Public Sub New(LogConfig As LogConfig)
_Logger = LogConfig.GetLogger()
End Sub
Public Sub DrawRectangle(Bounds As Rectangle)
Dim oContext As IntPtr
oContext = NativeMethods.GetDC(IntPtr.Zero)
Try
Dim g As Graphics
g = Graphics.FromHdc(oContext)
Try
g.DrawRectangle(Pens.Red, Bounds)
Finally
g.Dispose()
End Try
Finally
NativeMethods.ReleaseDC(IntPtr.Zero, oContext)
End Try
End Sub
End Class