1
EDais graphics programming tutorial
Basic introduction to
Graphics programming in VB
Written by Mike D Sutton Of EDais
Http://www.mvps.org/EDais/
EDais@mvps.org
- 05.03.2002 -
Http://www.mvps.org/EDais/
2
EDais graphics programming tutorial
VB graphics programming
I was asked recently where on the site one should go to find a basic introduction to
graphics programming in VB, and I realised that there was nothing that really covered
the basics; things that once you’re messing around with more advanced things you
tend to take for granted (and indeed I had done in my other tutorials on the subject.)
As such I’m writing this tutorial with no assumed knowledge (hopefully) apart from a
very basic knowledge of VB programming in general.
Chapter 1 - The picture box
Chapter 2 - Basic drawing
Chapter 3 - Customising drawing
Chapter 4 - Working with images (Bitmaps)
Chapter 5 - Image manipulation
Chapter 6 - Introduction to the API
Chapter 7 - Migrating to API drawing
Chapter 8 - Customising drawing and Image manipulation with the API
Chapter 9 - System colours
Chapter 10 - Further reading
Http://www.mvps.org/EDais/
IInnttrroodduuccttiioonn
3
EDais graphics programming tutorial
CChhaapptteerr IIThe picture box
First thing’s first, before we can draw any kind of graphics we’ll need to draw it onto
so I’ll introduce you to your best friend when graphics programming – the picture box
control.
Drop one on a form now and let’s have a look at it
Note: The Image control is not the same as the picture box control and will not allow
you do the same things
Ok, it doesn’t look like much but let’s have a quick look at some of its properties.
The “Appearance” property is the first one we’ll look at. If you go to change its
value, you’ll see that it turns into a little drop down menu with two options; flat and
3D. Changing the property to flat makes the border of the picture box just a single
line rather than the ‘bevelled’ effect we get with the 3D proper