Return to package dfl. www.dprogramming.com

module dfl.drawing

classes
Bitmap Brush Font Graphics HatchBrush Icon Image Pen Region SolidBrush SystemColors TextFormat
enums
FontStyle GraphicsUnit HatchStyle PenStyle TextAlignment TextFormatFlags TextTrimming
structs
Color Point Rect Size

Bitmap
public class Bitmap: Image
{
public void dispose(); public final void draw(Graphics g, Point pt); public final void draw(Graphics g, Point pt, Graphics tempMemGraphics); public final void drawStretched(Graphics g, Rectangle r); public final void drawStretched(Graphics g, Rectangle r, Graphics tempMemGraphics); public final HBITMAP handle();    [property getter] public final int height();    [property getter] public final Size size();    [property getter] public this(char[] fileName); public this(HBITMAP hbm, bool owned = true); public final int width();    [property getter] public ~this();
}

Brush
public class Brush
{
public final HBRUSH handle();    [property getter] public this(HBRUSH hb, bool owned = true); protected this(); public ~this();
}

Color
public struct Color
{
public ubyte a();    [property getter] public ubyte b();    [property getter] public static Color empty();    [property getter] public static Color fromRgb(COLORREF rgb); public ubyte g();    [property getter] public static Color opCall(ubyte alpha, Color c); public static Color opCall(COLORREF argb); public static Color opCall(ubyte alpha, ubyte red, ubyte green, ubyte blue); public static Color opCall(ubyte red, ubyte green, ubyte blue); public ubyte r();    [property getter] public COLORREF toArgb(); public COLORREF toRgb();
}

Font
public class Font
{
public final HFONT handle();    [property getter] public this(char[] name, float emSize, FontStyle style, GraphicsUnit unit); public this(char[] name, float emSize, FontStyle style, GraphicsUnit unit, ubyte gdiCharSet); public this(char[] name, float emSize, GraphicsUnit unit); public this(HFONT hf, bool owned = true); public this(char[] name, float emSize, FontStyle style); public this(char[] name, float emSize); public this(Font font, FontStyle style); public ~this();
}

FontStyle
public enum FontStyle: ubyte
{
	REGULAR,
	BOLD,
	ITALIC,
	UNDERLINE,
	STRIKEOUT,
}

Graphics
public class Graphics
{
public void dispose(); public final void drawArc(Pen pen, int x, int y, int width, int height, int arcX1, int arcY1, int arcX2, int arcY2); public final void drawArc(Pen pen, Rect r, Point arc1, Point arc2); public final void drawBezier(Pen pen, Point[4] points); public final void drawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4); public final void drawBeziers(Pen pen, Point[] points); public final void drawEllipse(Pen pen, Rect r); public final void drawEllipse(Pen pen, int x, int y, int width, int height); public final void drawIcon(Icon icon, Rect r); public final void drawIcon(Icon icon, int x, int y); public final void drawLine(Pen pen, int startX, int startY, int endX, int endY); public final void drawLine(Pen pen, Point start, Point end); public final void drawLines(Pen pen, Point[] points); public final void drawPolygon(Pen pen, Point[] points); public final void drawRectangle(Pen pen, Rect r); public final void drawRectangle(Pen pen, int x, int y, int width, int height); public final void drawRectangles(Pen pen, Rect[] rs); public final void drawText(char[] text, Font font, Color color, Rect r, TextFormat fmt); public final void drawText(char[] text, Font font, Color color, Rect r); public final void fillRectangle(Brush brush, Rect r); public final void fillRectangle(Brush brush, int x, int y, int width, int height); public final void fillRectangle(Color color, Rect r); public final void fillRectangle(Color color, int x, int y, int width, int height); public final void fillRegion(Brush brush, Region region); public final void flush(); public static Graphics fromHwnd(HWND hwnd); public Color getNearestColor(Color c); public static Graphics getScreen(); public final HDC handle();    [property getter] public final Size measureText(char[] text, Font font); public this(HDC hdc, bool owned = true); public ~this();
}

GraphicsUnit
public enum GraphicsUnit: ubyte
{
	PIXEL,
	DISPLAY,
	DOCUMENT,
	INCH,
	MILLIMETER,
	POINT,
	TWIP,
}

HatchBrush
public class HatchBrush: Brush
{
public final Color foregroundColor();    [property getter] public final HatchStyle hatchStyle();    [property getter] public this(HatchStyle hs, Color c);
}

HatchStyle
public enum HatchStyle: LONG
{
	HORIZONTAL,
	VERTICAL,
	FORWARD_DIAGONAL,
	BACKWARD_DIAGONAL,
	CROSS,
	DIAGONAL_CROSS,
}

Icon
public class Icon
{
public void dispose(); public static Icon fromHandle(HICON hi); public final HICON handle();    [property getter] public final int height();    [property getter] public final Size size();    [property getter] public this(HICON hi, bool owned = true); public final Bitmap toBitmap(); public final int width();    [property getter] public ~this();
}

Image
public abstract class Image
{
public void draw(Graphics g, Point pt); public void drawStretched(Graphics g, Rect r); public static Bitmap fromHBitmap(HBITMAP hbm); public int height();    [property getter] public Size size();    [property getter] public int width();    [property getter]
}

Pen
public class Pen
{
public final HPEN handle();    [property getter] public this(HPEN hp, bool owned = true); public this(Color color, int width = 1, PenStyle ps = PenStyle.SOLID); public ~this();
}

PenStyle
public enum PenStyle: UINT
{
	SOLID,
	DASH,
	DOT,
	DASH_DOT,
	DASH_DOT_DOT,
	NULL,
	INSIDE_FRAME,
}

Point
public struct Point
{
public union __anonymous {
public struct __anonymous {
public LONG x; public LONG y;
}

public POINT point;

}

public Point opAdd(Size sz); public void opAddAssign(Size sz); public static Point opCall(int x, int y); public static Point opCall(); public int opEquals(Point pt); public Point opSub(Size sz); public void opSubAssign(Size sz);

}

Rect
public struct Rect
{
public int bottom();    [property getter] public bool contains(int c_x, int c_y); public bool contains(Rect r); public bool contains(Point pos); public static Rect fromLTRB(int left, int top, int right, int bottom); public void getRect(RECT* r); public void inflate(Size insz); public void inflate(int i_width, int i_height); public bool intersectsWith(Rect r); public Point location();    [property getter] public void location(Point pt);    [property setter] public static Rect opCall(int x, int y, int width, int height); public static Rect opCall(); public static Rect opCall(RECT* rect); public static Rect opCall(Point location, Size size); public int opEquals(Rect r); public int right();    [property getter] public Size size();    [property getter] public void size(Size sz);    [property setter] public int x; public int y; public int width; public int height;
}

Region
public class Region
{
public final HRGN handle();    [property getter] public override int opEquals(Object o); public int opEquals(Region rgn); public this(HRGN hrgn, bool owned = true); public ~this();
}

Size
public struct Size
{
public union __anonymous {
public struct __anonymous {
public int width; public int height;
}

public SIZE size;

}

public Size opAdd(Size sz); public void opAddAssign(Size sz); public static Size opCall(int width, int height); public static Size opCall(); public int opEquals(Size sz); public Size opSub(Size sz); public void opSubAssign(Size sz);

}

SolidBrush
public class SolidBrush: Brush
{
public final Color color();    [property getter] public this(Color c);
}

SystemColors
public class SystemColors
{
public static Color activeBorder();    [property getter] public static Color activeCaption();    [property getter] public static Color activeCaptionText();    [property getter] public static Color appWorkspace();    [property getter] public static Color control();    [property getter] public static Color controlDark();    [property getter] public static Color controlDarkDark();    [property getter] public static Color controlLight();    [property getter] public static Color controlLightLight();    [property getter] public static Color controlText();    [property getter] public static Color desktop();    [property getter] public static Color grayText();    [property getter] public static Color highlight();    [property getter] public static Color highlightText();    [property getter] public static Color hotTrack();    [property getter] public static Color inactiveBorder();    [property getter] public static Color inactiveCaption();    [property getter] public static Color inactiveCaptionText();    [property getter] public static Color info();    [property getter] public static Color infoText();    [property getter] public static Color menu();    [property getter] public static Color menuText();    [property getter] public static Color scrollBar();    [property getter] public static Color window();    [property getter] public static Color windowFrame();    [property getter] public static Color windowText();    [property getter]
}

TextAlignment
public enum TextAlignment: UINT
{
	LEFT,
	RIGHT,
	CENTER,
	TOP,
	BOTTOM,
	MIDDLE,
}

TextFormat
public class TextFormat
{
public final TextAlignment alignment();    [property getter] public final void alignment(TextAlignment ta);    [property setter] public final TextFormatFlags formatFlags();    [property getter] public final void formatFlags(TextFormatFlags tff);    [property setter] public static TextFormat genericDefault();    [property getter] public static TextFormat genericTypographic();    [property getter] public final void leftMargin(int sz);    [property setter] public final int leftMargin();    [property getter] public final void rightMargin(int sz);    [property setter] public final int rightMargin();    [property getter] public final int tabLength();    [property getter] public final void tabLength(int tablen);    [property setter] public this(TextFormat tf); public this(); public this(TextFormatFlags flags); public final void trimming(TextTrimming tt);    [property getter] public final TextTrimming trimming();    [property getter]
}

TextFormatFlags
public enum TextFormatFlags: UINT
{
	NO_PREFIX,
	DIRECTION_RIGHT_TO_LEFT,
	WORD_BREAK,
	SINGLE_LINE,
	NO_CLIP,
	LINE_LIMIT,
}

TextTrimming
public enum TextTrimming: UINT
{
	NONE,
	ELLIPSIS,
	ELLIPSIS_PATH,
}