11# Region "Microsoft.VisualBasic::659ef9b9553bb1ab585e2ca28d9bf882, R#\Runtime\Environment\Device\RContentOutput.vb"
22
3- ' Author:
4- '
5- ' asuka (amethyst.asuka@gcmodeller.org)
6- ' xie (genetics@smrucc.org)
7- ' xieguigang (xie.guigang@live.com)
8- '
9- ' Copyright (c) 2018 GPL3 Licensed
10- '
11- '
12- ' GNU GENERAL PUBLIC LICENSE (GPL3)
13- '
14- '
15- ' This program is free software: you can redistribute it and/or modify
16- ' it under the terms of the GNU General Public License as published by
17- ' the Free Software Foundation, either version 3 of the License, or
18- ' (at your option) any later version.
19- '
20- ' This program is distributed in the hope that it will be useful,
21- ' but WITHOUT ANY WARRANTY; without even the implied warranty of
22- ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23- ' GNU General Public License for more details.
24- '
25- ' You should have received a copy of the GNU General Public License
26- ' along with this program. If not, see <http://www.gnu.org/licenses/>.
27-
28-
29-
30- ' /********************************************************************************/
31-
32- ' Summaries:
33-
34-
35- ' Code Statistics:
36-
37- ' Total Lines: 216
38- ' Code Lines: 147 (68.06%)
39- ' Comment Lines: 33 (15.28%)
40- ' - Xml Docs: 100.00%
41- '
42- ' Blank Lines: 36 (16.67%)
43- ' File Size: 7.23 KB
44-
45-
46- ' Class RContentOutput
47- '
48- ' Properties: Encoding, env, isLogOpen, recommendType, stream
49- '
50- ' Constructor: (+1 Overloads) Sub New
51- ' Sub: closeSink, Flush, LoggingDriver, openSink, (+5 Overloads) Write
52- ' (+2 Overloads) WriteLine, WriteStream
53- '
54- '
55- ' /********************************************************************************/
3+ ' Author:
4+ '
5+ ' asuka (amethyst.asuka@gcmodeller.org)
6+ ' xie (genetics@smrucc.org)
7+ ' xieguigang (xie.guigang@live.com)
8+ '
9+ ' Copyright (c) 2018 GPL3 Licensed
10+ '
11+ '
12+ ' GNU GENERAL PUBLIC LICENSE (GPL3)
13+ '
14+ '
15+ ' This program is free software: you can redistribute it and/or modify
16+ ' it under the terms of the GNU General Public License as published by
17+ ' the Free Software Foundation, either version 3 of the License, or
18+ ' (at your option) any later version.
19+ '
20+ ' This program is distributed in the hope that it will be useful,
21+ ' but WITHOUT ANY WARRANTY; without even the implied warranty of
22+ ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+ ' GNU General Public License for more details.
24+ '
25+ ' You should have received a copy of the GNU General Public License
26+ ' along with this program. If not, see <http://www.gnu.org/licenses/>.
27+
28+
29+
30+ ' /********************************************************************************/
31+
32+ ' Summaries:
33+
34+
35+ ' Code Statistics:
36+
37+ ' Total Lines: 216
38+ ' Code Lines: 147 (68.06%)
39+ ' Comment Lines: 33 (15.28%)
40+ ' - Xml Docs: 100.00%
41+ '
42+ ' Blank Lines: 36 (16.67%)
43+ ' File Size: 7.23 KB
44+
45+
46+ ' Class RContentOutput
47+ '
48+ ' Properties: Encoding, env, isLogOpen, recommendType, stream
49+ '
50+ ' Constructor: (+1 Overloads) Sub New
51+ ' Sub: closeSink, Flush, LoggingDriver, openSink, (+5 Overloads) Write
52+ ' (+2 Overloads) WriteLine, WriteStream
53+ '
54+ '
55+ ' /********************************************************************************/
5656
5757# End Region
5858
59- Imports System.Drawing
60- Imports System.Drawing.Imaging
59+ Imports Microsoft.VisualBasic.Imaging
6160Imports System.IO
6261Imports System.Runtime.CompilerServices
6362Imports System.Text
@@ -68,6 +67,13 @@ Imports SMRUCC.Rsharp.Runtime.Internal.Invokes
6867Imports SMRUCC.Rsharp.Runtime.Internal.Object
6968Imports SMRUCC.Rsharp.Runtime.Internal.Object.Utils
7069
70+ # If NET48 Then
71+ Imports System.Drawing.Imaging
72+ Imports Image = System.Drawing.Image
73+ # Else
74+ Imports Image = Microsoft.VisualBasic.Imaging.Image
75+ # End If
76+
7177Namespace Runtime
7278
7379 ''' <summary>
@@ -260,7 +266,11 @@ Namespace Runtime
260266 _recommendType = "image/png"
261267
262268 Using buffer As New MemoryStream
269+ # If NET48 Then
263270 Call image.Save(buffer, ImageFormat.Png)
271+ # Else
272+ Call image.Save(buffer, ImageFormats.Png)
273+ # End If
264274 Call Write(buffer.ToArray)
265275 End Using
266276 End Sub
0 commit comments