Tuesday, March 13, 2012

Vb.Net Draw In Picturebox

‘System.Drawing’ can be one of the fun working libraries for working on interesting tasks like imaging. This is loaded with a lot of features that can make the drawing and imaging activities much easier.

I usually prefer to work with bitmap when I am working on the imaging. The reason behind is, it has a lot of properties and methods to work with.  We can easily save, change the pixel, and retrieve the pixel.

Just like drawing the lines, pixels, circles on an image, it is very easy to write a text on the image using graphic object’s DrawString() method. This graphic object has to be based on the image where we are going to write to. So use the FromImage function of the Graphics to get the graphics object of the image.

Graphics object can be used to format the image, text. So use the properly suited overloaded method to handle the required formats using font, brush, location. I demonstrated how to use brush, and font in a very simple manner. Though you can do bold, italics, colorful, I will leave it to you to discover.

_
Partial Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.

View the original article here

No comments:

Post a Comment