Storage type used by the GDI buffer.
Forwards Windows GDI calls.
DirectView interface.
Wraps and owns the Windows API objects.
Implements the view[x, y] operator.
Implements the view[x, y] = c operator.
alias RGB = ae.utils.graphics.color.RGB; // alias BGR COLOR; alias BGRX COLOR; auto b = GDICanvas!COLOR(100, 100); b.fill(COLOR(255, 255, 255)); const str = "Hello, world!"; auto f = CreateFont(-11, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Tahoma"); scope(exit) DeleteObject(f); b.SelectObject(f); b.SetBkColor(0xFFFFFF); b.SetTextColor(0x0000FF); b.TextOutA(10, 10, str.ptr, cast(uint)str.length); b.SetPixel(5, 5, 0xFF0000); GdiFlush(); b[6, 6] = COLOR(255, 0, 0); import ae.utils.graphics.image; auto i = b.copy.colorMap!(c => RGB(c.r,c.g,c.b))(); assert(i[5, 5] == RGB(0, 0, 255)); assert(i[6, 6] == RGB(0, 0, 255)); assert(i[7, 7] == RGB(255, 255, 255)); // i.savePNG("gditest.png"); // i.savePNM("gditest.pnm");
A canvas with added GDI functionality.