You are here:About>Computing & Technology>Visual Basic> Using VB.NET> GDI+ Graphics in Visual Basic 2005 .NET
About.comVisual Basic
Newsletters & RSSEmail to a friendSubmit to Digg

GDI+ Graphics in Visual Basic 2005 .NET

From Dan Mabbutt,
Your Guide to Visual Basic.
FREE Newsletter. Sign Up Now!
Mar 10 2007

Part 9 of an About Visual Basic Tutorial

GDI+ is the way to draw shapes, fonts, images or generally anything graphic in Visual Basic .NET. You can get the most from this tutorial by starting with Part 1 where the fundamentals of GDI+ are explained.

Previous Lesson Links

  • Part 1 - Introduction to GDI+ and the Graphics object
  • Part 2 - Drawing a curve with a series of connected points
  • Part 3 - Advanced vector graphics with an intro to bitmapped graphics
  • Part 4 - Blending and merging colors and shapes in the same graphic
  • Part 5 - Coordinate Spaces and Matrix Transformations
  • Part 6 - Using the GraphicsPath object and clipping regions
  • Part 7 - Colors and Transparency
  • Part 8 - Image Based Graphics

In Part 8 of the tutorial, I promised more about using Metafile files for graphics. Metafiles are files that describe a sequence of graphics operations. The advantage is that you can record the operations to create a graphic and then play it back again. Some other vendors, such as Adobe Illustrator, also support the Metafile format. In a sense, we have returned to a discussion of "vector graphics" because Metafile files are an alternative to bitmapped files. Instead of the actual pixel information in an image, the vector graphic commands to create the image are used.

Metafile files come in two flavors: WMF (Windows Metafiles) and EMF (Enhanced Metafiles). WMF is the older 16-bit format. EMF is the newer 32-bit format with some added features. GDI+ can record metafiles in the EMF and EMF+ formats, but not in the WMF format. For that, you have to go back to the older GDI. Microsoft warns that the extensibility feature of EMF, "can lead to incompatibilities between different types of EMF pictures." There is also an EMF+ format that also comes in two flavors. "EMF+ Only" and "EMF+ Dual". EMF+ Dual has extra information that allows the older GDI system to display the files as well.

Doncha just love it when Microsoft creates all these variations to confuse you!

To get the essential flavor of metafiles, let's create one! That happens on the next page.

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.