Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static class: RT.Util.Drawing.GraphicsUtil

Summary

Contains static methods for various graphics-related operations.

Static methods

Color
ColorBlend(Color color, Color backColor, double amount)
Blends the specified colors together.
Bitmap
DrawBitmap(int width, int height, Action<Graphics> draw, bool keepLowQuality = false)
Creates a new bitmap by executing the specified drawing command(s) on a blank new 32-bit bitmap.
void
DrawImageAlpha(this Graphics graphics, Image image, Rectangle destRect, float opacity)
Draws the specified image into the destination rectangle destRect of the graphics object using the specified opacity.
void
DrawRoundedRectangle(this Graphics g, Pen pen, RectangleF rectangle, float radius, bool tolerant = false)
Draws a rounded rectangle.
void
DrawRoundedRectangle(this Graphics g, Pen pen, float x, float y, float width, float height, float radius, bool tolerant = false)
Rectangle
FitIntoMaintainAspectRatio(this Size fitWhat, Rectangle fitInto)
Returns a rectangle that has the same aspect ratio as fitWhat but fits into fitInto.
Color
FromHsv(double hue, double saturation, double value)
Converts hue, saturation and value into an RGB color object.
float
GetMaximumFontSize(this Graphics graphics, SizeF maximumSize, FontFamily fontFamily, string text, FontStyle style = Regular, bool allowWordWrapping = false)
Determines the largest font size at which the specified text fits into the specified maximum size in the specified font.
float
GetMaximumFontSize(this Graphics graphics, FontFamily fontFamily, string text, FontStyle style = Regular, bool allowWordWrapping = false, float? maxWidth = null, float? maxHeight = null)
Bitmap
MakeSemitransparentImage(Size size, Action<Graphics> initGraphics, Action<Graphics> drawOpaqueLayer, Action<Graphics> drawTransparencyLayer)
Generates an image by taking the color components from one image and the transparency (alpha) layer from another.
Bitmap
MakeSemitransparentImage(int width, int height, Action<Graphics> initGraphics, Action<Graphics> drawOpaqueLayer, Action<Graphics> drawTransparencyLayer, int transparencyFromChannel = 0, bool invertTransparency = false)
GraphicsPath
RoundedRectangle(RectangleF rectangle, float radius, bool tolerant = false)
Returns a GraphicsPath object that represents a rounded rectangle.
GraphicsPath
RoundedRectangle(float x, float y, float width, float height, float radius, bool tolerant = false)
void
SetHighQuality(this Graphics g)
Sets the interpolation mode, smoothing mode, text rendering hint and compositing quality for the specified Graphics object to high quality.
Bitmap
SetTransparencyChannel(this Bitmap source, Bitmap transparencyLayer, int channel, bool invert = false)
Modifies the current bitmap’s transparency layer by setting it to the data from another bitmap.