C# Класс Accord.Imaging.Drawing

Drawing primitives.

The class allows to do drawing of some primitives directly on locked image data or unmanaged image.

All methods of this class support drawing only on color 24/32 bpp images and on grayscale 8 bpp indexed images.

When it comes to alpha blending for 24/32 bpp images, all calculations are done as described on Wikipeadia (see "over" operator).

Показать файл Открыть проект

Открытые методы

Метод Описание
FillRectangle ( BitmapData imageData, Rectangle rectangle, Color color ) : void

Fill rectangle on the specified image.

FillRectangle ( UnmanagedImage image, Rectangle rectangle, Color color ) : void

Fill rectangle on the specified image.

Line ( BitmapData imageData, IntPoint point1, IntPoint point2, Color color ) : void

Draw a line on the specified image.

Line ( UnmanagedImage image, IntPoint point1, IntPoint point2, Color color ) : void

Draw a line on the specified image.

Polygon ( BitmapData imageData, List points, Color color ) : void

Draw a polygon on the specified image.

The method draws a polygon by connecting all points from the first one to the last one and then connecting the last point with the first one.

Polygon ( UnmanagedImage image, List points, Color color ) : void

Draw a polygon on the specified image.

The method draws a polygon by connecting all points from the first one to the last one and then connecting the last point with the first one.

Polyline ( BitmapData imageData, List points, Color color ) : void

Draw a polyline on the specified image.

The method draws a polyline by connecting all points from the first one to the last one. Unlike Polygon( BitmapData, List{IntPoint}, Color ) method, this method does not connect the last point with the first one.

Polyline ( UnmanagedImage image, List points, Color color ) : void

Draw a polyline on the specified image.

The method draws a polyline by connecting all points from the first one to the last one. Unlike Polygon( UnmanagedImage, List{IntPoint}, Color ) method, this method does not connect the last point with the first one.

Rectangle ( BitmapData imageData, Rectangle rectangle, Color color ) : void

Draw rectangle on the specified image.

Rectangle ( UnmanagedImage image, Rectangle rectangle, Color color ) : void

Draw rectangle on the specified image.

Приватные методы

Метод Описание
CheckEndPoint ( int width, int height, IntPoint start, IntPoint &end ) : void
CheckPixelFormat ( PixelFormat format ) : void

Описание методов

FillRectangle() публичный статический Метод

Fill rectangle on the specified image.
The source image has incorrect pixel format.
public static FillRectangle ( BitmapData imageData, Rectangle rectangle, Color color ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to draw on.
rectangle System.Drawing.Rectangle Rectangle's coordinates to fill.
color Color Rectangle's color.
Результат void

FillRectangle() публичный статический Метод

Fill rectangle on the specified image.
The source image has incorrect pixel format.
public static FillRectangle ( UnmanagedImage image, Rectangle rectangle, Color color ) : void
image UnmanagedImage Source image to draw on.
rectangle System.Drawing.Rectangle Rectangle's coordinates to fill.
color Color Rectangle's color.
Результат void

Line() публичный статический Метод

Draw a line on the specified image.
The source image has incorrect pixel format.
public static Line ( BitmapData imageData, IntPoint point1, IntPoint point2, Color color ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to draw on.
point1 IntPoint The first point to connect.
point2 IntPoint The second point to connect.
color Color Line's color.
Результат void

Line() публичный статический Метод

Draw a line on the specified image.
The source image has incorrect pixel format.
public static Line ( UnmanagedImage image, IntPoint point1, IntPoint point2, Color color ) : void
image UnmanagedImage Source image to draw on.
point1 IntPoint The first point to connect.
point2 IntPoint The second point to connect.
color Color Line's color.
Результат void

Polygon() публичный статический Метод

Draw a polygon on the specified image.

The method draws a polygon by connecting all points from the first one to the last one and then connecting the last point with the first one.

public static Polygon ( BitmapData imageData, List points, Color color ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to draw on.
points List Points of the polygon to draw.
color Color Polygon's color.
Результат void

Polygon() публичный статический Метод

Draw a polygon on the specified image.

The method draws a polygon by connecting all points from the first one to the last one and then connecting the last point with the first one.

public static Polygon ( UnmanagedImage image, List points, Color color ) : void
image UnmanagedImage Source image to draw on.
points List Points of the polygon to draw.
color Color Polygon's color.
Результат void

Polyline() публичный статический Метод

Draw a polyline on the specified image.

The method draws a polyline by connecting all points from the first one to the last one. Unlike Polygon( BitmapData, List{IntPoint}, Color ) method, this method does not connect the last point with the first one.

public static Polyline ( BitmapData imageData, List points, Color color ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to draw on.
points List Points of the polyline to draw.
color Color polyline's color.
Результат void

Polyline() публичный статический Метод

Draw a polyline on the specified image.

The method draws a polyline by connecting all points from the first one to the last one. Unlike Polygon( UnmanagedImage, List{IntPoint}, Color ) method, this method does not connect the last point with the first one.

public static Polyline ( UnmanagedImage image, List points, Color color ) : void
image UnmanagedImage Source image to draw on.
points List Points of the polyline to draw.
color Color polyline's color.
Результат void

Rectangle() публичный статический Метод

Draw rectangle on the specified image.
The source image has incorrect pixel format.
public static Rectangle ( BitmapData imageData, Rectangle rectangle, Color color ) : void
imageData System.Drawing.Imaging.BitmapData Source image data to draw on.
rectangle System.Drawing.Rectangle Rectangle's coordinates to draw.
color Color Rectangle's color.
Результат void

Rectangle() публичный статический Метод

Draw rectangle on the specified image.
The source image has incorrect pixel format.
public static Rectangle ( UnmanagedImage image, Rectangle rectangle, Color color ) : void
image UnmanagedImage Source image to draw on.
rectangle System.Drawing.Rectangle Rectangle's coordinates to draw.
color Color Rectangle's color.
Результат void