Skip to main content

Custom Drawing

Paint Event​

Handle a control's Paint event to draw through e.Graphics. Wisej.NET sends the resulting image to the browser as the control's background. Custom painting therefore replaces BackgroundImage. See Custom Painting for an example.

GDI+​

Windows GDI+ is a class-based API for C/C++ programmers. It enables applications to use graphics and formatted text on both the video display and the printer. Applications based on the Microsoft Win32 API do not access graphics hardware directly. Instead, GDI+ interacts with device drivers on behalf of applications. GDI+ is also supported by Microsoft Win64.

Memory​

Wisej.NET releases the temporary image used to send the painting result to the browser. Your application is still responsible for disposing of drawing resources it creates, such as custom brushes, pens, and images.

Third Party Controls​

Use the Widget control to integrate a JavaScript drawing library and connect its events to server-side code. Choose custom painting when you want to generate an image on the server, or a client-side widget when the library needs to manage its own browser rendering.

Canvas Control​

The Canvas control exposes HTML5 canvas drawing operations to C# and VB.NET. Handle its Redraw event to issue drawing commands. Unlike the Paint event, this approach uses the browser's canvas drawing surface.