Questions tagged [system.drawing.common]
21 questions
14
votes
2 answers
.NET 6 System.Drawing.Common Runtime Switch
According to https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only System.Drawing.Common is no longer supported under on non-windows OS UNLESS a runtime configuration switch is set. I've…

Kevin Micallef
- 143
- 1
- 1
- 4
7
votes
1 answer
Using C# to measure the width of a string in pixels in a cross platform way
I have some existing C# code that uses System.Drawing.Common to measure the approximate width of a string in pixels:
var text = "abc123 this is some long text my dog's name is fido.";
using (var bitmap = new Bitmap(500, 50))
using (var graphics =…

Jon Sagara
- 1,122
- 2
- 11
- 16
4
votes
1 answer
System.Drawing.Common DrawString not rendering text properly in Linux
So I'm not sure what the issue is and have exhausted just about every option I can think of. I am targeting dotnet core 3.0 on Ubuntu 18.04 LTS. On a windows environment it works fine but in this Ubuntu environment text just does not render the way…

Tonic
- 51
- 2
3
votes
1 answer
How to fix the security vulnerability in system.drawing.common 4.7.0 package refered by Microsoft.EntityFrameworkCore.SqlServer(6.0.3)?
In Visual Studio 2022, API project created using .NET Core 6.0.6 runtime, we are using Microsoft.EntityFrameworkCore.SqlServer 6.0.3 nuget package. But recently found that there is a security vulnerability in the System.Drawing.Common 4.7.0…

RAMA KRISHNA
- 31
- 2
1
vote
1 answer
Resolve conflict between System.Drawing and System.Drawing.Common
I am trying to add SpreadSheetLight to a new Dnn v9.10.2 project running on Windows Server 2019, but I get a runtime error saying
CS0433: The type 'Image' exists in both 'System.Drawing.Common,
Version=4.0.0.1, Culture=neutral,…

Accuraty-Jared
- 29
- 5
1
vote
0 answers
Render Bitmaps by using SkiaSharp instead of System.Drawing
With the recent update to Net 6.0 the System.Drawing.Common libary is only supported on Windows. In my WPF Application I decided to swap it for SkiaSharp but encountered a problem in the process.
Every information I found about rendering with Skia…

Mazzelfassel
- 13
- 1
- 4
1
vote
2 answers
Resizing and creating image thumbnail in ASP.NET-Core 2.2
I am trying to create a thumbnail image in asp.net-core 2.2 application but I keep getting the above error whenever it gets to the point of creating the thumbnail.
The main image creates and stores fine but it is not able to create the thumbnail.…

Josh
- 1,660
- 5
- 33
- 55
1
vote
1 answer
.NET Core System.Drawing.Common PrintDocument doesn't work on Linux
I have a problem with PrintDocument from System.Drawing.Common when I use this on Linux, to be more specific, the problem comes from PrintingServices.LoadPrinterSettings, which is using in PrinterSettings.Unix
here the content of the…

Egaheer
- 11
- 1
- 3
1
vote
2 answers
System.OverflowException: 'Arithmetic operation resulted in an overflow.'
I created .NET Core console app and added reference to System.Drawing.Common nuget.
I'm trying to run the following code from ms docs, but it fails on bitmap1.GetEncoderParameterList with System.OverflowException:
'Arithmetic operation resulted in…

Access Denied
- 8,723
- 4
- 42
- 72
0
votes
0 answers
Is it safe to use System.Drawing.Common 4.7.3?
Until recently my project had a dependency on System.Drawing.Common version 4.5.1, and it seemed to work fine both on Windows and on Linux. But then I noticed the security warning and decided to upgrade. At first I upgraded to the latest stable…

Arnon Axelrod
- 1,444
- 2
- 13
- 21
0
votes
0 answers
C# using System.Drawing.Common; gives error name 'Common' does not exist in the namespace 'System.Drawing'
I am having a C# WPF desktop app project on .NET6 in Visual Studio.
Project Sdk="Microsoft.NET.Sdk">
WinExe
net6.0-windows
enable
…

Alex
- 707
- 1
- 4
- 9
0
votes
0 answers
Modifying trays in printer driver is not reflected in PaperSources
I have a running application to work with printers and their trays. My current implementation does not recognize added or removed trays of a printer via windows driver. To get these changes I need to restart the whole application. But if a printer…

Manuel
- 1
- 1
0
votes
0 answers
Convert FFMpegCore Bitmap to Stream on Linux
I have a DotNet Core 7 app, which utilises the rather wonderful FFMpegCore by Malte Rosenbjerg to get snapshots of video using FFMpeg. I'm converting my app to run on Linux, but the FFMpeg.Snapshot function returns a System.Drawing.Bitmap, and the…

Dunc
- 31
- 6
0
votes
1 answer
System.Drawing.Image to SkiaSharp
I am trying to move my code from using System.Drawing.Image to using SkiaSharp as recommended here.
I trying to find similar operations for working with Tif files from a stream.
Currently, the following is what I have using…

usagibear
- 303
- 3
- 12
0
votes
1 answer
Error [System.DllNotFoundException: Unable to load shared library 'gdi32.dll' or one of its dependencies]?
I build a Application NetCore 3.1 ,it using System.Drawing.Common.dll and run on ubuntu
System.DllNotFoundException: Unable to load shared library 'gdi32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting…

Shiva
- 1