AlterNET UI Beta 5 - Printing, extended graphic features, tray icon and tooltips

In AlterNET UI Beta 5, we have added support for some missing functionality as well as extended features that were previously released. These include printing and print preview support, a much more complete implementation of DrawingContext, tray icons, and tooltips.

Print and Print Preview

Similar to Windows Forms and WPF, printing in AlterNET UI is represented by the PrintDocument object, which sends output to a printer, and a set of standard dialogs such as the Print, Print Preview, and PageSetup dialogs. Printing is typically as simple as responding to the PrintDocument.PrintPage event and drawing your document page there using a DrawingContext.

Refer to our documentation for more details.

Graphic context advanced features

We have added more drawing context features:

  • The ability to draw more types of geometry: polygons, rounded rectangles, circles, Bezier curves, arcs, and pies.

  • Matrix transforms to translate/scale/rotate your graphics.

  • Graphics paths support drawing and filling complex sequences of graphical segments (lines, curves, arcs, and geometrical shapes).

  • New brush styles and pen options: linear and radial gradient brushes are supported.

  • More ways to draw images: you can draw from an arbitrary portion of an image to an arbitrary area of drawing context. Different interpolation modes for image scaling are supported.

All these features allow for the creation of complex graphical scenes.

Code

void Control_Paint(object? sender, PaintEventArgs e)
{
    var image = Resources.LogoImage;
    var dc = e.DrawingContext;

    double y = 10;
    dc.DrawText("Image:", Control.DefaultFont, Brushes.Black, new Point(10, y));
    y += 30;
    dc.DrawImage(image, new Point(10, y));

    dc.InterpolationMode = InterpolationMode.HighQuality;

    y += image.Size.Height + 10;
    dc.DrawText("Scaled Image:", Control.DefaultFont, Brushes.Black, new Point(10, y));
    y += 30;
    dc.DrawImage(image, new Rect(new Point(10, y), image.Size * 2));
}

Tray Icon and Tooltips

A tray icon enables the display of an icon with additional menus in the Windows or macOS taskbar. At the same time, tooltips briefly describe controls or framework elements when the mouse hovers over them.

We’re planning to release one more beta before the first public release. Subscribe to our newsletter and stay tuned for more AlterNET UI news.

Previous
Previous

AlterNET UI Beta 6 - Toolbar and StatusBar controls, resource URI support.

Next
Next

AlterNET UI Beta 4 - What you see is what you get