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