System.Drawing Espacio de nombres
Proporciona acceso a la funcionalidad básica de gráficos de GDI+. Provides access to GDI+ basic graphics functionality. En los espacios de nombres System.Drawing.Drawing2D, System.Drawing.Imaging y System.Drawing.Text se proporciona funcionalidad más avanzada. More advanced functionality is provided in the System.Drawing.Drawing2D, System.Drawing.Imaging, and System.Drawing.Text namespaces.
Clases
| Bitmap |
Encapsula un mapa de bits de GDI+, que está formado por los datos de píxeles de una imagen de gráficos y sus atributos.Encapsulates a GDI+ bitmap, which consists of the pixel data for a graphics image and its attributes. Bitmap es un objeto que se utiliza para trabajar con imágenes definidas mediante datos de píxeles.A Bitmap is an object used to work with images defined by pixel data. |
| BitmapSuffixInSameAssemblyAttribute |
Especifica que, al interpretar las declaraciones de ToolboxBitmapAttribute, el ensamblado debe buscar los recursos indicados en el mismo ensamblado, pero con el valor de configuración de BitmapSuffix anexado al nombre de archivo declarado.Specifies that, when interpreting ToolboxBitmapAttribute declarations, the assembly should look for the indicated resources in the same assembly, but with the BitmapSuffix configuration value appended to the declared file name. |
| BitmapSuffixInSatelliteAssemblyAttribute |
Especifica que, al interpretar las declaraciones de ToolboxBitmapAttribute, el ensamblado debe buscar los recursos indicados en un ensamblado satélite, pero con el valor de configuración de BitmapSuffix anexado al nombre de archivo declarado.Specifies that, when interpreting ToolboxBitmapAttribute declarations, the assembly should look for the indicated resources in a satellite assembly, but with the BitmapSuffix configuration value appended to the declared file name. |
| Brush |
Define los objetos que se utilizan para rellenar formas de gráficos, por ejemplo rectángulos, elipses, gráficos circulares y rutas.Defines objects used to fill the interiors of graphical shapes such as rectangles, ellipses, pies, polygons, and paths. |
| Brushes |
Pinceles de todos los colores estándar.Brushes for all the standard colors. Esta clase no puede heredarse.This class cannot be inherited. |
| BufferedGraphics |
Proporciona un búfer gráfico para el doble búfer.Provides a graphics buffer for double buffering. |
| BufferedGraphicsContext |
Proporciona los métodos para crear búferes de gráficos que se pueden utilizar para el almacenamiento en doble búfer.Provides methods for creating graphics buffers that can be used for double buffering. |
| BufferedGraphicsManager |
Proporciona acceso al principal objeto de contexto gráfico almacenado en búfer para el dominio de aplicación.Provides access to the main buffered graphics context object for the application domain. |
| ColorConverter |
Convierte los colores de un tipo de datos a otro.Converts colors from one data type to another. Obtenga acceso a esta clase a través de TypeDescriptor.Access this class through the TypeDescriptor. |
| ColorTranslator |
Convierte colores a y desde estructuras Color de GDI+.Translates colors to and from GDI+ Color structures. Esta clase no puede heredarse.This class cannot be inherited. |
| Font |
Define un formato concreto para el texto, incluidos el nombre de fuente, el tamaño y los atributos de estilo.Defines a particular format for text, including font face, size, and style attributes. Esta clase no puede heredarse.This class cannot be inherited. |
| FontConverter |
Convierte objetos Font de un tipo de datos a otro.Converts Font objects from one data type to another. |
| FontConverter.FontNameConverter |
FontConverter.FontNameConverter es un convertidor de tipos que se utiliza para convertir un nombre de fuente en otras representaciones y viceversa.FontConverter.FontNameConverter is a type converter that is used to convert a font name to and from various other representations. |
| FontConverter.FontUnitConverter |
Convierte unidades de fuente en otros tipos de unidad y viceversa.Converts font units to and from other unit types. |
| FontFamily |
Define un grupo de tipos de letra que tienen un diseño básico parecido y algunas diferencias de estilo.Defines a group of type faces having a similar basic design and certain variations in styles. Esta clase no puede heredarse.This class cannot be inherited. |
| Graphics |
Encapsula una superficie de dibujo de GDI+.Encapsulates a GDI+ drawing surface. Esta clase no puede heredarse.This class cannot be inherited. |
| Icon |
Representa un icono de Windows, que es una pequeña imagen de mapa de bits que se usa para representar un objeto.Represents a Windows icon, which is a small bitmap image that is used to represent an object. Los iconos se pueden considerar como mapas de bits transparentes, aunque su tamaño lo determina el sistema.Icons can be thought of as transparent bitmaps, although their size is determined by the system. |
| IconConverter |
Convierte un objeto Icon de un tipo de datos a otro.Converts an Icon object from one data type to another. Obtenga acceso a esta clase mediante el objeto TypeDescriptor.Access this class through the TypeDescriptor object. |
| Image |
Clase base abstracta que proporciona funcionalidad para las clases descendentes Bitmap y Metafile.An abstract base class that provides functionality for the Bitmap and Metafile descended classes. |
| ImageAnimator |
Anima una imagen que tiene marcos basados en tiempo.Animates an image that has time-based frames. |
| ImageConverter |
ImageConverter es una clase que se puede utilizar para convertir objetos Image de un tipo de datos a otro.ImageConverter is a class that can be used to convert Image objects from one data type to another. Obtenga acceso a esta clase mediante el objeto TypeDescriptor.Access this class through the TypeDescriptor object. |
| ImageFormatConverter |
ImageFormatConverter es una clase que se puede utilizar para convertir objetos ImageFormat de un tipo de datos a otro.ImageFormatConverter is a class that can be used to convert ImageFormat objects from one data type to another. Obtenga acceso a esta clase mediante el objeto TypeDescriptor.Access this class through the TypeDescriptor object. |
| Pen |
Define un objeto usado para dibujar líneas y curvas.Defines an object used to draw lines and curves. Esta clase no puede heredarse.This class cannot be inherited. |
| Pens |
Lápices de todos los colores estándar.Pens for all the standard colors. Esta clase no puede heredarse.This class cannot be inherited. |
| PointConverter |
Convierte objetos Point de un tipo de datos en otro.Converts a Point object from one data type to another. |
| RectangleConverter |
Convierte rectángulos de un tipo en otro tipo.Converts rectangles from one data type to another. Obtenga acceso a esta clase a través de TypeDescriptor.Access this class through the TypeDescriptor. |
| Region |
Describe el interior de una forma gráfica formada por rectángulos y rutas.Describes the interior of a graphics shape composed of rectangles and paths. Esta clase no puede heredarse.This class cannot be inherited. |
| SizeConverter |
SizeConverter es una clase que se utiliza para convertir un tipo de datos en otro.The SizeConverter class is used to convert from one data type to another. Obtenga acceso a esta clase mediante el objeto TypeDescriptor.Access this class through the TypeDescriptor object. |
| SizeFConverter |
Convierte el tipo de los objetos SizeF en otro.Converts SizeF objects from one type to another. |
| SolidBrush |
Define un pincel de un solo color.Defines a brush of a single color. Los pinceles se utilizan para rellenar formas de gráficos, por ejemplo rectángulos, elipses, gráficos circulares y rutas.Brushes are used to fill graphics shapes, such as rectangles, ellipses, pies, polygons, and paths. Esta clase no puede heredarse.This class cannot be inherited. |
| StringFormat |
Encapsula información de diseño del texto (como alineación, orientación y tabulaciones), manipulaciones de presentación (como inserción de puntos suspensivos y sustitución de dígitos nacionales) y características de OpenType.Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. Esta clase no puede heredarse.This class cannot be inherited. |
| SystemBrushes |
Cada una de las propiedades de la clase SystemBrushes es una estructura SolidBrush que es el color de un elemento de presentación de Windows.Each property of the SystemBrushes class is a SolidBrush that is the color of a Windows display element. |
| SystemColors |
Cada una de las propiedades de la clase SystemColors es una estructura Color que es el color de un elemento de presentación de Windows.Each property of the SystemColors class is a Color structure that is the color of a Windows display element. |
| SystemFonts |
Especifica las fuentes que se utilizan para mostrar texto en los elementos representados de Windows.Specifies the fonts used to display text in Windows display elements. |
| SystemIcons |
Cada una de las propiedades de la clase SystemIcons es un objeto Icon de los iconos de todo del sistema de Windows.Each property of the SystemIcons class is an Icon object for Windows system-wide icons. Esta clase no puede heredarse.This class cannot be inherited. |
| SystemPens |
Cada una de las propiedades de la clase SystemPens es un objeto Pen que es el color de un elemento de presentación de Windows y tiene un ancho de 1 píxel.Each property of the SystemPens class is a Pen that is the color of a Windows display element and that has a width of 1 pixel. |
| TextureBrush |
Cada una de las propiedades de la clase TextureBrush es un objeto Brush que utiliza una imagen para rellenar el interior de una forma.Each property of the TextureBrush class is a Brush object that uses an image to fill the interior of a shape. Esta clase no puede heredarse.This class cannot be inherited. |
| ToolboxBitmapAttribute |
Le permite especificar un icono para representar un control en un contenedor, como el Diseñador de formularios de Microsoft Visual Studio.Allows you to specify an icon to represent a control in a container, such as the Microsoft Visual Studio Form Designer. |
Estructuras
| CharacterRange |
Especifica un intervalo de posiciones de caracteres en una cadena.Specifies a range of character positions within a string. |
| Color |
Representa un color de ARGB (alfa, rojo, verde y azul).Represents an ARGB (alpha, red, green, blue) color. |
| Point |
Representa un par ordenado de coordenadas enteras x e y que define un punto en un plano bidimensional.Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane. |
| PointF |
Representa un par ordenado de coordenadas x e y de punto flotante que define un punto en un plano bidimensional.Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane. |
| Rectangle |
Almacena un conjunto de cuatro enteros que representan la posición y el tamaño de un rectángulo.Stores a set of four integers that represent the location and size of a rectangle. |
| RectangleF |
Almacena un conjunto de cuatro números de punto flotante que representan la posición y tamaño de un rectángulo.Stores a set of four floating-point numbers that represent the location and size of a rectangle. Para las funciones de región más avanzadas, use un objeto Region.For more advanced region functions, use a Region object. |
| Size |
Almacena un par ordenado de enteros, que especifican Height y Width.Stores an ordered pair of integers, which specify a Height and Width. |
| SizeF |
Almacena un par de números de punto flotante ordenados, normalmente el ancho y el alto de un rectángulo.Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle. |
Interfaces
| IDeviceContext |
Define métodos para obtener y liberar un identificador existente de un contexto de dispositivo de Windows.Defines methods for obtaining and releasing an existing handle to a Windows device context. |
Enumeraciones
| ContentAlignment |
Especifica la alineación del contenido en la superficie de dibujo.Specifies alignment of content on the drawing surface. |
| CopyPixelOperation |
Determina cómo el color de origen en una operación de copiar píxeles se combina con el color de destino para que se genere el color final.Determines how the source color in a copy pixel operation is combined with the destination color to result in a final color. |
| FontStyle |
Especifica la información de estilo que se aplica al texto.Specifies style information applied to text. |
| GraphicsUnit |
Especifica la unidad de medida de unos datos concretos.Specifies the unit of measure for the given data. |
| KnownColor |
Especifica los colores del sistema conocidos.Specifies the known system colors. |
| RotateFlipType |
Especifica cuánto se gira una imagen y el eje que se usa para voltearla.Specifies how much an image is rotated and the axis used to flip the image. |
| StringAlignment |
Determina la alineación de una cadena de texto en relación con el rectángulo de diseño correspondiente.Specifies the alignment of a text string relative to its layout rectangle. |
| StringDigitSubstitute |
La enumeración StringDigitSubstitute especifica cómo sustituir los dígitos de una cadena según la configuración regional o el idioma del usuario.The StringDigitSubstitute enumeration specifies how to substitute digits in a string according to a user's locale or language. |
| StringFormatFlags |
Especifica la información de diseño y de presentación de las cadenas de texto.Specifies the display and layout information for text strings. |
| StringTrimming |
Especifica cómo recortar los caracteres de una cadena que no caben por completo en una forma de diseño.Specifies how to trim characters from a string that does not completely fit into a layout shape. |
| StringUnit |
Especifica la unidad de medida de una cadena de texto.Specifies the units of measure for a text string. |
Delegados
| Graphics.DrawImageAbort |
Proporciona un método de devolución de llamada para decidir cuándo el método DrawImage debe cancelar anticipadamente la ejecución y dejar de dibujar una imagen.Provides a callback method for deciding when the DrawImage method should prematurely cancel execution and stop drawing an image. |
| Graphics.EnumerateMetafileProc |
Proporciona un método de devolución de llamada para el método EnumerateMetafile.Provides a callback method for the EnumerateMetafile method. |
| Image.GetThumbnailImageAbort |
Proporciona un método de devolución de llamada para decidir cuándo el método GetThumbnailImage(Int32, Int32, Image+GetThumbnailImageAbort, IntPtr) debe cancelar anticipadamente la ejecución.Provides a callback method for determining when the GetThumbnailImage(Int32, Int32, Image+GetThumbnailImageAbort, IntPtr) method should prematurely cancel execution. |
Comentarios
Precaución
System.DrawingNo se recomienda el espacio de nombres para el nuevo desarrollo, porque no se admite en los servicios de Windows, ASP.net Core y ASP.net.TheSystem.Drawingnamespace is not recommended for new development, because it's not supported within Windows services, ASP.NET Core, and ASP.NET. Si se intentan usarSystem.Drawingclases dentro de uno de estos tipos de aplicación, pueden producirse excepciones en tiempo de ejecución y un rendimiento de servicio reducido.Attempting to useSystem.Drawingclasses within one of these application types may result in run-time exceptions and diminished service performance. Entre las alternativas recomendadas se incluyen ImageSharp, SkiaSharpy componentes de creación de imágenes de Windows.Recommended alternatives include ImageSharp, SkiaSharp, and Windows Imaging Components.- En Windows,
System.Drawingdepende de la biblioteca nativa de GDI+, que se distribuye como parte del sistema operativo.On Windows,System.Drawingdepends on the GDI+ native library, which is shipped as part of the OS. Algunas SKU de Windows, como Windows Server Core o Windows nano, no incluyen esta biblioteca nativa como parte del sistema operativo.Some Windows SKUs, like Windows Server Core or Windows Nano, don't include this native library as part of the OS. Se producirán excepciones en tiempo de ejecución porque no se puede cargar la biblioteca.Exceptions will be thrown at run time because the library can't be loaded.
La Graphics clase proporciona métodos para dibujar en el dispositivo de pantalla.The Graphics class provides methods for drawing to the display device. Clases como Rectangle y Point encapsulan primitivas GDI+.Classes such as Rectangle and Point encapsulate GDI+ primitives. La Pen clase se utiliza para dibujar líneas y curvas, mientras que las clases derivadas de la clase abstracta Brush se utilizan para rellenar el interior de las formas.The Pen class is used to draw lines and curves, while classes derived from the abstract class Brush are used to fill the interiors of shapes.
Precaución
Las clases del System.Drawing espacio de nombres no se admiten para su uso en un servicio de Windows o ASP.net.Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Intentar usar estas clases desde dentro de uno de estos tipos de aplicación puede producir problemas inesperados, como el rendimiento del servicio reducido y las excepciones en tiempo de ejecución.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. Para obtener una alternativa compatible, vea componentes de Windows Imaging.For a supported alternative, see Windows Imaging Components.