Graphics


System.Windows.Point

This is different to System.Drawing.Point


System.Drawing

more details


2D vector Graphics

This includes objects for drawing lines, polygons, ellipses and arcs with either solid or gradient filled brushes
Most of the objects for doing 2D vector graphics are in the System.Drawing and System.Drawing.Drawing2D namespaces.


Imaging

This gathers objects for displaying and processing image formats such as bitmaps and icons.
include image stretching, conversion to and from the most common graphic formats and support for semitransparent regions by means of alpha blending.
These objects can be found in the System.Drawing.Imaging namespace.


Typography

Includes all the objects that are used to display text in a variety of forms, colours and styles
You can even activate anti-aliasing and special techniques for better text rendering on LCD screens such as PDAs.
These objects can be found in the System.Drawing.Text namespace.


Windows GDI

This graphics device library allows applications to use and make changes to graphics and formatted text
Used for representing graphical objects and transmitting them to various output devices for example monitors and printers
It is responsible for tasks such as drawing lines, rendering fonts
Simple games not requiring fast graphics could use GDI


Windows GDI+

This resides in the System.Drawing.dll assembly
The GDI+ classes include Graphics, Pen, Brush, Rectangle


Colours

There are several different approaches you can use when working with colours.


Using the "const" keyword will not work because this is a structure

public static System.Drawing.Color MYCOLOR = new System.Drawing,Color.FromArgb(10,10,10); 

more details


RGB Integer

You may also come across colour properties that take an integer value:

objLineShape.Line.BackColor.RGB = Microsoft.VisualBasic.Information.RGB(50,10,40) 


Saving Images

Different file formats (.bmp .png .wmf .jpg .emf)


Bitmap

System.Drawing.Bitmap oBitmap; 
oBitmap = New System.Drawing.Bitmap("c:\temp\test.bmp")


PNG

System.Drawing.Bitmap oBitmap; 
oBitmap.Save("c:\temp\test.png, System.Drawing.Imaging.ImageFormat.Png);


SVG

Scalable Vector Graphic



List of Printers currently installed

This gets the list of printers that are currently installed

Dim sPrinterName As String 
For Each sPrinterName In System.Drawing.Printing.PrinterSettings.InstalledPrinters
   System.Windows.Forms.MessageBox.Show(sPrinterName)
Next sPrinterName


Using the Windows Management Instrumentation (WMI) Library

This can be used to provide a list of all network printers.
It is an additional library though and therefore will require an additional reference (System.Management.dll)

Dim objSearcher As Management.ManagementObjectSearcher 
Dim objCollectionResults As Management.ManagementObjectCollection
Dim objPrinter As Management.ManagementObject

objSearcher = New Management.ManagementObjectSearcher("Select * FROM Win32_Printer")
objCollectionResults = objSearcher.Get()
For Each objPrinter In objCollectionResults
   System.Windows.Forms.MessageBox.Show(objPrinter.Name)
Next objPrinter

Information about the Default Printer

Printer settings can be accessed from within the PrintDocument object

Dim objPrintDocument As System.Drawing.Printing.PrintDocument 
System.Windows.Forms.MessageBox.Show(objPrintDocument.PrinterSettings.PrintName)

objPrintDocument.PrintSettings.IsValid


Getting Display Dimensions

This will tell you the size of the users screen.

Dim objStringBuilder As System.Text.StringBuilder 
Dim objScreen As Screen

'number of screens
Screen.AllScreens.Length.ToString

For Each objScreen In Screen.AllScreens
   objScreen.DeviceName
   objScreen.Bounds
   objScreen.WorkingArea
   objScreen.Primary
Next objScreen



© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrev