Return to package dfl. www.dprogramming.com

module dfl.drawing

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

Bitmap
public class Bitmap: Image
{
public void dispose(); public final override void draw(Graphics g, Point pt); public final void draw(Graphics g, Point pt, Graphics tempMemGraphics); public final override void drawStretched(Graphics g, Rect r); public final void drawStretched(Graphics g, Rect r, Graphics tempMemGraphics); public final HBITMAP handle();    [property getter] public final override int height();    [property getter] public final override Size size();    [property getter] public this(char[] fileName); public this(HBITMAP hbm, bool owned = true); public final override 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 Color blendColor(Color wc); public static Color empty();    [property getter] public static Color fromArgb(ubyte alpha, ubyte red, ubyte green, ubyte blue); public static Color fromRgb(ubyte alpha, COLORREF rgb); public static Color fromRgb(COLORREF rgb); public ubyte g();    [property getter] public static Color opCall(ubyte alpha, Color c); 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 Color solidColor(Color backColor); public COLORREF toArgb(); public COLORREF toRgb(); public static Color transparent();    [property getter]
}

Font
public class Font
{
public final ubyte gdiCharSet();    [property getter] public final float getSize(GraphicsUnit unit, Graphics g); public final float getSize(GraphicsUnit unit); public final HFONT handle();    [property getter] public final char[] name();    [property getter] public final float size();    [property getter] public final FontStyle style();    [property getter] public this(char[] name, float emSize, GraphicsUnit unit); public this(char[] name, float emSize, FontStyle style, GraphicsUnit unit); public this(char[] name, float emSize, FontStyle style); public this(Font font, FontStyle style); public this(char[] name, float emSize, FontStyle style, GraphicsUnit unit, ubyte gdiCharSet); public this(char[] name, float emSize); public final GraphicsUnit unit();    [property getter] public ~this();
}

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

Graphics
public class Graphics
{
public final bool copyTo(Graphics destGraphics, Rect bounds); public final bool copyTo(Graphics destGraphics, int destX, int destY, int width, int height, int srcX, int srcY, DWORD rop); public final bool copyTo(Graphics destGraphics, int destX, int destY, int width, int height, int srcX, int srcY); public final bool copyTo(Graphics destGraphics, int destX, int destY, int width, int height); public void dispose(); public final void drawArc(Pen pen, Rect r, Point arc1, Point arc2); 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 drawBezier(Pen pen, Point pt1, Point pt2, Point pt3, Point pt4); public final void drawBezier(Pen pen, Point[4] points); 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, Point start, Point end); public final void drawLine(Pen pen, int startX, int startY, int endX, int endY); public final void drawLines(Pen pen, Point[] points); public final void drawPolygon(Pen pen, Point[] points); public final void drawRectangle(Pen pen, int x, int y, int width, int height); public final void drawRectangle(Pen pen, Rect r); 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 drawTextDisabled(char[] text, Font font, Color color, Color backColor, Rect r); public final void drawTextDisabled(char[] text, Font font, Color color, Color backColor, Rect r, TextFormat fmt); 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, int x, int y, int width, int height); public final void fillRectangle(Color color, Rect r); public final void fillRegion(Brush brush, Region region); public final void flush(); public static Graphics fromHwnd(HWND hwnd); public final Color getNearestColor(Color c); public final Size getScaleSize(Font f); public static Graphics getScreen(); public final char[] getTrimmedText(char[] text, Font font, Rect r, TextTrimming trim); public final HDC handle();    [property getter] public final Size measureText(char[] text, Font font); public final Size measureText(char[] text, Font font, int maxWidth); public final Size measureText(char[] text, Font font, TextFormat fmt); public final Size measureText(char[] text, Font font, int maxWidth, TextFormat fmt); 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: Image
{
public void dispose(); public final override void draw(Graphics g, Point pt); public final override void drawStretched(Graphics g, Rect r); public static Icon fromHandle(HICON hi); public final HICON handle();    [property getter] public final override int height();    [property getter] public final override Size size();    [property getter] public this(HICON hi, bool owned = true); public final Bitmap toBitmap(); public final override 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 int height();    [property getter] public Size size(); public int width();    [property getter]
}

MemoryGraphics
public class MemoryGraphics: Graphics
{
public override void dispose(); public final int height();    [property getter] public this(int width, int height); public this(int width, int height, Graphics graphicsCompatible); public final 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,
}

Picture
public class Picture: Image
{
public void dispose(); public final override void draw(Graphics g, Point pt); public final override void drawStretched(Graphics g, Rect r); public static Picture fromFile(char[] fileName); public static Picture fromStream(Stream stm); public final int getHeight(Graphics g); public final Size getSize(Graphics g); public final int getWidth(Graphics g); public final override int height();    [property getter] public final OLE_XSIZE_HIMETRIC loghimX();    [property getter] public final OLE_YSIZE_HIMETRIC loghimY();    [property getter] public final override Size size();    [property getter] public this(Stream stm); public this(char[] fileName); public final Bitmap toBitmap(Graphics g); public final Bitmap toBitmap(); public final override int width();    [property getter] public ~this();
}

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 void offset(int x, int y); public void offset(Point pt); public static Rect opCall(int x, int y, int width, int height); public static Rect opCall(RECT* rect); public static Rect opCall(); 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]
}

SystemIcons
public class SystemIcons
{
public static Icon application();    [property getter] public static Icon error();    [property getter] public static Icon question();    [property getter] public static Icon warning();    [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,
}