Questions tagged [system.drawing]

System.Drawing is a namespace of the .NET framework. It provides access to GDI+ basic graphics functionality.

System.Drawing is a namespace of the .NET framework. It provides access to GDI+ basic graphics functionality.

Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions. For a supported alternative, see Windows Imaging Components.

References

1129 questions
-1
votes
1 answer

How do I resize an image without stretching it?

I am trying to resize an image (bitmap) in C# without stretching the image. Say the image is 100x100 pixels. I am looking to make it 100x110 pixels, and leave a white gap at the bottom of the image where it added the extra pixels. I have done…
-1
votes
1 answer

A nicer PixelFormat.ToString output

The PixelFormat enumeration from the System.Drawing.Imaging namespace has members like Format32bppArgb or Format8bppIndexed, that are displayed when calling its ToString method. Do you know of a built-in or other method that converts PixelFormat…
TechAurelian
  • 5,561
  • 5
  • 50
  • 65
-1
votes
1 answer

How to rotate and resize a PNG image by two changing coordinates?

If there is a PNG image connects two coordinates (like a rope), coordinateA.x; coordinateA.y; coordinateB.x; coordinateB.y; The two coordinates will keep changing all the time, so the PNG image connects between two coordinates needs to resize and…
user1589684
  • 45
  • 1
  • 1
  • 5
-1
votes
1 answer

I have some error in C# Drawing Application?

i am using visual studio 2010 for making a Drawing Application but the problem is when i try to compile the program it says 1)The type name 'DrawingBoard' does not exist in the type 'DrawingBoard.DrawingBoard' line 33 2)The type name 'Toolbox' does…
alexander
  • 1
  • 1
-1
votes
1 answer

Whys is Graphics.Clear(); Not working in C#

I am doing some revision for my comp103 paper and I cant get the button with the Graphics.Clear(); method to clear the graphics paper. Can someone please point out the error in my code as I have spent about an hour trying to find an answer on the…
Actionable
  • 21
  • 1
  • 1
  • 2
-2
votes
1 answer

How to draw these triangles in C# and save the result in BMP image format?

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 triangleSize = int.Parse(args[0]); int depth =…
Arnas
  • 1
  • 5
-2
votes
1 answer

C# Graphics class want to make signature panel : input from drawing tablet

i am trying to make signature panel in c# windowsform application where input is from drawing tablet my code as below this code working for line drawing not dot created. So please suggest how dot and line both are create. { Graphics…
Mp594
  • 9
  • 3
-2
votes
1 answer

How to shrink an image to a target size in bytes in C#?

How to shrink an image to a target size in bytes in C#? Specifically, I am looking to take an image uploaded to an ASP.NET full framework application and shrink it so that it is less or equal to a maximum number of bytes (e.g. 1 MB). I am OK with…
Bryan Bedard
  • 2,619
  • 1
  • 23
  • 22
-2
votes
1 answer

How to draw a rounded rectangle with width less than height? C#

I have been looking for quite a while for an already pre-made function for creating a rounded rectangle that doesn't cause tearing/glitching like the one below. Credits to @György Kőszeg. This function works fine if the rectangle is big enough. When…
-2
votes
1 answer

Finding Closest Edge to a Point in a PictureBox

I need to find 2 closest edges to a point within a picturebox.I'm using the following method void findclosestedges(Point p) { //Xedge=1 -- Left Edge is closer to Point 2--Right Edge int Xedge,Yedge; …
techno
  • 6,100
  • 16
  • 86
  • 192
-2
votes
2 answers

Find remaining outer rectangles from Rectangle.Intersection

I have an outer rectangle and a rectangle inside. How can I return all remaining rectangle after cut of intersecting rectangle?
Mauro Destro
  • 746
  • 12
  • 34
-2
votes
1 answer

HSV triangle in C#

For my assignment I need to make to make a color picker that looks like this: I've got the wheel part but can't figure out how to draw the triangle.
-2
votes
1 answer

'System.Drawing.Color' does not contain a definition for 'FromARgb'

I have added System.Drawing as a reference, yet this code seems to fail on the line where I declare the new color using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using…
Elmub
  • 141
  • 1
  • 2
  • 11
-2
votes
2 answers

How can I create 'pages' from scratch to be printed or print previewed in c#?

Due to the overwhelming complexity and/or limited license capabilities of the components available for this job, I have decided to write this component from scratch. This is something I have fully functional in PHP, and in VB6. but I am hitting a…
Kraang Prime
  • 9,981
  • 10
  • 58
  • 124
-2
votes
1 answer

How to set FillEllipse color by user defined/choice at the development time in Custom Control

Here you can see the control property of text and in the similar manner I want to do something like - FillEllipse should be able to decide the user that which color he wants to choose from the property bar (presents a right hand side). For example…
1 2 3
75
76