Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
119 views

Graphics.DrawString(string, Font, Brush, RectangleF, StringFormat) is drawing my text in DisplayUnits (1/100th inch) when it should be drawing it in Points (1/72 inch). It's not the bounding layout ...
javery's user avatar
  • 41
0 votes
0 answers
28 views

In Windows the settings of paper sizes supported by the printers (found under Print Server Properties/Forms) include paper size and margins However, the class System.Drawing.Printing.Papersize ...
Vadim Rapp's user avatar
-6 votes
2 answers
148 views

I have the following code: System.Drawing.Image img1 = System.Drawing.Image.FromFile(imgPath); System.Drawing.Image img2 = System.Drawing.Image.FromFile(imgPath); img2.RotateFlip(RotateFlipType....
user107586's user avatar
-1 votes
1 answer
97 views

For testing purposes, I want to fill out a method like this one: public static Image Image(int width, int height, Color color) I would prefer to avoid involving physical files at all. I just want the ...
William Jockusch's user avatar
0 votes
0 answers
61 views

I'm Trying to export merge multi image to one page two sides (2 by 5) in A4 size output in VB.NET. So the total image is 10 in 1 A4 page Please Guide Me Thanks Imports System.IO Public Class Form1 ...
dlaksmi's user avatar
  • 213
0 votes
0 answers
45 views

I can't seem to get the tag I'm adding to an image to stick once I save the image to a memory stream. Any idea how I can get that tag to end up in the imageCache byte array after I try and copy it to ...
Arvo Bowen's user avatar
  • 4,968
0 votes
1 answer
177 views

Is there any possibility to measure a text width and height on .NET6+ cross-platform? Something like: var font = new Font("Arial", 16); var gfx = Graphics.FromImage(new Bitmap(1, 1)); var ...
dennis's user avatar
  • 326
-2 votes
1 answer
125 views

I'm working on moving a C# program into a WPF application and in order to export files from records I need to use the following code: // Construct _imgfiles from the records string _imgfile = ...
Esai's user avatar
  • 1
1 vote
0 answers
97 views

I am looking for the best way to draw or display wind barbs and I am using C# Windows Forms for my project. In this project I tried to use ESRI weather fonts. But the challenge I had with it was that ...
saeed gholampoor's user avatar
0 votes
0 answers
74 views

I have the following extension methods to create thumbnails from a photo in a .NET Core 8 web application: public static class ImageExtensions { public static Image ToThumbnail(this Image image, ...
jstuardo's user avatar
  • 4,497
1 vote
2 answers
685 views

I am trying to get a base64 image string into the system.drawing.image object (done) and then back out to base64 (not working), to include inline in an HTML e-mail, but am having difficulty. The below ...
user66001's user avatar
  • 950
0 votes
0 answers
59 views

I have been trying to make some basic 2D cnc like simulator, with some rectangle that is shaped by tools etc. I want to make cursor, so the user know where the current position of tool is. But I don't ...
Vojtjikjhh -4K-'s user avatar
1 vote
0 answers
31 views

Using C# and .NET Core 8, I am aware that System.Drawing.Printing is now firmly Windows only. However this also means I have no access to these symbols/routines at design time or compile time from ...
Simon's user avatar
  • 1,406
0 votes
0 answers
48 views

The functionality I want to achieve, is being able to copy a rectangle off of a part of image and pasting that part to another same dimension image in the same place. I want to use it to blur parts of ...
Simas Paškauskas's user avatar
2 votes
0 answers
239 views

I just want to create an image which contains some text. This text can contain emojis. I'm using the "Segoe UI Emoji" font, and call: var fontName = "Segoe UI Emoji"; var font = ...
jcmag's user avatar
  • 267
0 votes
1 answer
116 views

I'm trying to draw the same text from textBox to Panel char By Char For both Arabic & English with the same char size and position also style and color my code works perfectly if the text is ...
Amro Omran's user avatar
0 votes
2 answers
134 views

Hello stackoverflow! I am attempting to fill an ellipse with a LinearGradientBrush to "simulate" the dark and sun "sides" of a planet. Variable ovalCenter is the 3D vector (System....
DMP's user avatar
  • 35
-3 votes
1 answer
224 views

I have 2 points A(x1, y1) and B(x2, y2) on a circle and the angle between them alpha(example = 70 degree) I would like to find the center of the circle and radius I use System.Drawing namespace of C# ...
NGUYEN HAI's user avatar
5 votes
1 answer
10k views

We've been migrating a .NET 4.x application to .NET 8 and encountered a massive problem with System.Drawing.Bitmap. Our image processing was heavily dependent on graphic libraries, such as AForge. The ...
Ponderer's user avatar
0 votes
0 answers
217 views

I have a service running on a windows server 2019 VM that during setup will get a list of printers available using the below List<string> printers = PrinterSettings.InstalledPrinters.Cast<...
kob's user avatar
  • 3
3 votes
1 answer
118 views

I have this code in JS: function getTextWidth(text, font) { const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); context.font = font; return ...
JudahA's user avatar
  • 91
0 votes
0 answers
135 views

How can you make this shape in C# using DrawArc And Draw Line? Dashed Lines Is For Description Figure. This image should be able to rotate around the center. MaxRange And MinRange,The center point can ...
Saba system's user avatar
0 votes
0 answers
106 views

I'm a low skilled hobby programmer and I wrote a program with a function to get the color of a pixel on the screen. The following Method is not wrote by myself. My Program is running for about 20 ...
trading_dog's user avatar
1 vote
0 answers
43 views

I'm trying to make a program that would create images in C#. It would make some calculations, without any user interface, then export a bitmap image. For that last part I tried to use System.Drawing ...
lionclem's user avatar
1 vote
1 answer
817 views

I'm looking to change the color of the tab on the currently active tabpage to make it stand out more. I have set the DrawMode to OwnerDrawFixed and I was able to convert some c# code, found on another ...
J P's user avatar
  • 321
2 votes
0 answers
1k views

Recently I started to get warnings such as: CA1416: This call site is reachable on all platforms. 'Image' is only supported on: 'windows'.. When I looked for more information about it I found that ...
Arnon Axelrod's user avatar
0 votes
1 answer
79 views

I'm trying to draw a rectangle with rounded corners. But when I print the layout there's a problem with the lines like the image below: while the image that I need to print is this: This is the part ...
Francesco Vargas's user avatar
0 votes
0 answers
82 views

I am trying to create an image in C# using the Drawing classes. The image has a grid and I want to create a gradient header similar to this image. Can I get some guidance on how to do this? I tried ...
Karl's user avatar
  • 53
0 votes
1 answer
290 views

I'm attempting to use the Bebas font to render text to a Bitmap in C#. Consider the following code that loads a .png from the filesystem to render overlaying text: public Bitmap CreateCard(...
ravibhagw's user avatar
  • 1,740
0 votes
1 answer
66 views

Using the System.Drawing.Printing namespace, to set the Paper Size of a document, the PaperSize PrintDocument.DefaultPageSettings.PaperSize { get; set; } property is used. When printing in an SDK-...
etberg's user avatar
  • 121
0 votes
0 answers
85 views

its possible create a loop gif. The code at the moment, add a label on gif but he repeat 30 times and them stopped... string originalImgPath = @"..\35.gif"; System.Drawing.Image IMG = System....
Cost's user avatar
  • 53
0 votes
1 answer
364 views

I need a function in C# that returns merged bitmaps vertically. I want the resulting image to contain two bitmaps set one above the other. I don't have much experience with processing images in unsafe ...
pl.lepko's user avatar
0 votes
0 answers
217 views

I need to draw a lot of 2D graphics in the window. If I keep refreshing, it will lead to slow efficiency. I have learned about the drawing method with dirty rectangles. When using dirty rectangles for ...
gzhhhhh's user avatar
1 vote
1 answer
221 views

When passing a Bitmap to a method using thread.Start() and later calling bitmap.save() it throws the exception Invalid parameter when trying to save it to memory stream. I'm using a WPF project with ....
Tobs's user avatar
  • 63
4 votes
1 answer
781 views

I'm reading a .png file as a byte array and trying to encode the image as a jpeg by using both System.Drawing (Microsoft.NETCore.App 6.0.8) and SixLabors ImageSharp (3.0.1). I need the following ...
leone ruggiero's user avatar
0 votes
1 answer
70 views

Code: Bitmap btm = new Bitmap(800, 400); Graphics g = Graphics.FromImage(btm); using (GraphicsPath gp = new GraphicsPath()) using (Pen outline = new Pen(Brushes.Green, 2) { LineJoin = LineJoin.Round })...
ماهان نوروزی's user avatar
0 votes
0 answers
188 views

I'm trying to write a helper function in PowerShell that takes an image and resizes it. This is easy enough for static images, but I'm having trouble with Gifs. If I use the same logic on animated ...
Tor's user avatar
  • 784
0 votes
0 answers
496 views

I am using ASP.NET FileStreamResult to send back a file as a response to the user. It works fine on sending any file, but after calling some functions using System.Drawing to generate some files, it ...
KaraNoKara's user avatar
0 votes
1 answer
221 views

So I'm using System.Drawing Bitmap implementation. It looks like when setting format to PixelFormat.Format24bppRgb its actually interpreting it as 24 Bgr and not Rgb latestImage = new Bitmap(bitmap....
Mattias Kallsäby's user avatar
0 votes
0 answers
72 views

This is about printing to file like print to pdf and the like. My problem is that when user selects locked file through SaveFileDialog-like window PrintDocument.Print() throws Win32Exception. I catch ...
Breyer's user avatar
  • 11
4 votes
1 answer
2k views

I have this snippet of code to extract an icon from shell32.dll. $iconPath = "$env:SystemRoot\system32\shell32.dll" # Path to the shell32.dll library $iconIndex = 4 # Index of the folder ...
YorSubs's user avatar
  • 4,248
-2 votes
1 answer
232 views

What i need to draw using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; class Program { static void Main(string[] args) { int ...
Arnas's user avatar
  • 1
1 vote
0 answers
97 views

I am trying to change the color of all the arrows in a document to red. However, they keep changing to blue. I tried this: $shapes = $doc.Shapes foreach ($shape in $doc.Shapes) { if($shape.Name -...
ScareFries's user avatar
0 votes
0 answers
611 views

I made a windows service that's runs in background service and listening for web app to order to print. the web app send a pdf file and width and height of the printer paper with count of copies I ...
afshar003's user avatar
  • 839
2 votes
1 answer
1k views

I downloaded this repository from GitHub and try to run it on my MacOS laptop. It uses Signal R and web sockets. It builds, it starts, it works But when I try to open web socket I get an error: ...
Max Trunnikov's user avatar
0 votes
0 answers
69 views

I have 2 Bitmap (bmpA and bmpB) and in each I drawn a Line between 2 Points. These lines have different length. First: I want to scale bmpB so that the line drawn in it have to be the same of the ...
Christian Cascone's user avatar
1 vote
1 answer
426 views

On my brand new Windows 11 desktop, the bitmap I've been using to indicate a 'connected database' state in my stable production app is suddenly looking terrible on my 4K 150% scaled display (the ...
IV.'s user avatar
  • 9,646
1 vote
1 answer
3k views

I'm trying to run a simple C# Application on windows 11. I'm using the System.Drawing to edit a png file, but this error is occuring. System.PlatformNotSupportedException: 'System.Drawing.Common is ...
PS Jahn's user avatar
  • 33
1 vote
1 answer
10k views

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 ...
usagibear's user avatar
  • 395
2 votes
0 answers
1k views

So, I have a webp image bytes which I get from decoding base 64 string, but the thing is that Unity can not understand webp Images, so I have changed Unitys default .NET 2.1 to .NET Framework 4.x to ...
Limofeus's user avatar

1
2 3 4 5
23