add Modules.Windows
This commit is contained in:
27
Windows/Drawing.vb
Normal file
27
Windows/Drawing.vb
Normal 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
|
||||
Reference in New Issue
Block a user