Skip to content

Commit eb91dee

Browse files
committed
source file renames
1 parent 3e3c1f2 commit eb91dee

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

gr/Drawing-net4.8/GdiInterop.vb renamed to gr/Drawing-net4.8/Interop/GDIPlusInterop.vb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Imports System.IO
5656
Imports System.Runtime.CompilerServices
5757
Imports Microsoft.VisualBasic.Imaging
5858
Imports Microsoft.VisualBasic.Imaging.Driver
59+
Imports Microsoft.VisualBasic.ApplicationServices.Terminal.TablePrinter
60+
5961

6062
#If NET48 Then
6163
Imports Image = System.Drawing.Image
@@ -65,7 +67,7 @@ Imports Image = Microsoft.VisualBasic.Imaging.Image
6567
Imports Bitmap = Microsoft.VisualBasic.Imaging.Bitmap
6668
#End If
6769

68-
Public Module GdiInterop
70+
Public Module GDIPlusInterop
6971

7072
<Extension>
7173
Public Function CTypeGdiImage(image As Image) As System.Drawing.Image
@@ -122,4 +124,18 @@ Public Module GdiInterop
122124
End Using
123125
#End If
124126
End Function
127+
128+
<Extension>
129+
Public Function CastFontStyle(style As Microsoft.VisualBasic.Imaging.FontStyle) As System.Drawing.FontStyle
130+
Select Case style
131+
Case Microsoft.VisualBasic.Imaging.FontStyle.Regular : Return System.Drawing.FontStyle.Regular
132+
Case Microsoft.VisualBasic.Imaging.FontStyle.Bold : Return System.Drawing.FontStyle.Bold
133+
Case Microsoft.VisualBasic.Imaging.FontStyle.Italic : Return System.Drawing.FontStyle.Italic
134+
Case Microsoft.VisualBasic.Imaging.FontStyle.Underline : Return System.Drawing.FontStyle.Underline
135+
Case Microsoft.VisualBasic.Imaging.FontStyle.Strikeout : Return System.Drawing.FontStyle.Strikeout
136+
137+
Case Else
138+
Throw New NotImplementedException
139+
End Select
140+
End Function
125141
End Module

gr/Microsoft.VisualBasic.Imaging/Drivers/CreateGraphicsDriver.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Namespace Driver
130130
Call DriverLoad.Register(New RasterInterop, Drivers.GDI)
131131
Call DriverLoad.Register(New SvgInterop, Drivers.SVG)
132132
Call DriverLoad.Register(Function(text As String, font As Font)
133-
Return gfx.MeasureString(text, New System.Drawing.Font(font.Name, font.Size, font.Style))
133+
Return gfx.MeasureString(text, New System.Drawing.Font(font.Name, font.Size, font.Style.CastFontStyle))
134134
End Function)
135135
End Sub
136136

0 commit comments

Comments
 (0)