Guide for VB.NET
Core Document Formats
Additional Features
Draw .NET Graphics

VB.NET Imaging - Draw .NET Graphics in VB.NET

VB Code to Draw Image on .NET Graphics within .NET Imaging Drawing Library

Home > .NET Imaging SDK > VB.NET > Draw .NET Graphics
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

Have you ever tried to find a professional and standard .NET graphics drawing SDK to draw simple 2D objects like rectangle, line, square, and ellipse in VB.NET program? If so, RasterEdge VB.NET Graphics Drawing toolkit can fulfill all your needs.
Related .net document control helps: excel viewer: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser. image viewer: ASP.NET Image Viewer Control(MVC & WebForms): view, annotate, redact, convert image files in html, JQuery tiff viewer: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control edit pdf image: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C# sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint powerpoint viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET annotate pdf: ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
With this .NET Graphics Drawing and Writing control, developers and non-professional end users are competent to draw image, icon, line, ellipse, path, string, polygon, and many more objects on .NET graphics by using VB demo code, and users also can continue to work on the created image by processing, formatting and saving.
With our .NET graphics drawing library that is compatible with VB project, users will have the powerful capabilities to:
  • Set: define all the customizable properties that are needed to draw .NET graphics
  • Draw ellipse: draw and customize an ellipse shape on a certain .NET graphics area
  • Draw image: draw any supported file on a certain .NET graphics location
  • Draw line: draw a line with starting and ending points on .NET graphics with VB sample code
  • Draw polygon: draw and write a specified polygon object with three or more sides on .NET graphics in VB class
  • Draw rectangle: draw a rectangle with adjustable width and height on .NET graphics
In order to offer users with a better guidance, we are about to provide following modules of this .NET graphics drawing tutorial:
  • Function introduction of RasterEdge .NET Graphics Drawing toolkit in VB imaging project
  • Easy to use API solution for image and shape drawing on .NET graphics in VB sample code
  • How to draw and customize rectangle on .NET graphics in VB class
  • How to draw and write line image on specified .NET graphics with VB demo code
  • How to draw ellipse image on .NET graphics and save it to local file
VB .NET Graphics Drawing Feature List
  • Can be implemented within Microsoft .NET Framework 2.0 and all the above versions
  • Easy to set .NET graphics properties within simple VB code
  • Able to draw multiple image files and shapes on .NET graphics in VB class, like line, ellipse, rectangle, polygon, etc.
  • Support many VB.NET imaging processing functions for continuing work on image and shape manipulation
  • Save the drawn and written image and shape as a separate file to local file
.NET Graphics Drawing Methods in VB Class
Please adopt following API methods to draw images and shapes on .NET graphics within VB Windows program. And all the shapes that will be drawn on the .NET graphics can be pre-processed, such as, adjusting a proper color, setting graphics width & height and the font style property, and more.
Public Sub RectangleDrawing(mypen As Pen, myRectangle As Rectangle)
End Sub
Public Sub LineDrawing(mypen As Pen, pt1 As Point, pt2 As Point)
End Sub
Public Sub EllipseDrawing(maypen As Pen, pt1 As Point, pt2 As Point, pt3 As Point, pt4 As Point)
End Sub
Entire VB Code to Draw Rectangle, Line & Ellipse on .NET Graphics
In this part, we will display the complete VB sample code on how to draw and specify rectangle, line and ellipse objects on .NET graphics by using RasterEdge .NET Imaging Drawing SDK.

VB Code for Drawing Rectangle Image on .NET Graphics

Please refer to following pieces of VB demo code to draw a customized rectangle shape on VB.NET graphics. As displayed in the sample code, users can define the shape color, location, saving route, and many more.
Dim Image As New RasterEdgeImaging()

Public Sub RectangleDrawing()
If True Then
Dim LoadImage As New Bitmap("C:\1.jpg")
Dim Rectangle As Graphic = Graphics.FromImage(LoadImage)
Dim myPen As New Pen(System.Drawing.Color.Red, 5)
Dim myRectangle As New Rectangle(20, 20, 250, 200)
End If
End Sub
Rectangle.RectangleDrawing = (mypen, myrectangle)

VB Code to Draw Line Object on .NET Graphics

After you have successfully and precisely created a Windows application with VB programming language, you can implement following VB demo code directly to draw and individualize line image on the .NET graphics.
Dim Image As New RasterEdgeImaging()

Public Sub LineDrawing()
If True Then
Dim LoadImage As New Bitmap("C:\1.jpg")
Dim Line As Graphic = Graphics.FromImage(LoadImage)
Dim myPen As New Pen(Color.Black, 3)
Dim myLine As New Line(20, 20, 250, 200)
End If
End Sub
Line.LineDrawing = (mypen, pt1, pt2, pt3, pt4)

VB Code on Drawing Ellipse on .NET Graphics

Like drawing rectangle and line objects, it is very easy for users to draw ellipse image on .NET graphics with the help of following sample VB class code.
Dim Image As New RasterEdgeImaging()

Public Sub EllipseDrawing()
If True Then
Dim LoadImage As New Bitmap("C:\1.jpg")
Dim Ellipse As Graphic = Graphics.FromImage(LoadImage)
Dim myPen As New Pen(Color.Black, 3)
Dim myEllipse As New Rectangle(20, 20, 250, 200)
End If
End Sub
Ellipse.EllipseDrawing = (mypen, pt1, pt2, pt3, pt4)
More Tutorials!
You may see more Visual Basic guide for Using .NET Image SDK!

Recommend this to Google+ is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster