• Overview
  • How it works
  • Subscriptions and Plans
  • Documentation
  • Forum
  • Blog
Search Results for

    Show / Hide Table of Contents

    Rendering Graphics

    AlterNET UI incudes set of resolution-independent graphics features that use native rendering on every supported platform.

    It supports rendering graphic primitives such as text, images, graphic shapes with different fonts, pens and brushes.

    The following code example illustrates how graphics can be drawn in a UI element:

    using Alternet.Drawing;
    using Alternet.UI;
    
    namespace DrawingContextTutorial
    {
        public class DrawingControl : Control
        {
            public DrawingControl()
            {
                UserPaint = true;
            }
    
            protected override void OnPaint(PaintEventArgs e)
            {
                e.DrawingContext.FillRectangle(Brushes.LightBlue, e.Bounds);
    
                for (int size = 10; size < 200; size += 10)
                    e.DrawingContext.DrawEllipse(Pens.Red, new RectangleF(10, 10, size, size));
            }
        }
    }
    

    Window with Red Circular Pattern

    Refer to our blog post to see it in action.

    In This Article
    Back to top Documentation Licensing Info Copyright AlterNET Software