Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

388 Part III Designing the User Interface


Tip The complete Zoom In program is located in the C:\Vb10sbs\Chap15\Zoom In folder.


  1. Click the Start Debugging button to run the program.


The Earth image appears alone on the form.
Stars appear in the background because you have loaded the Space .jpg file onto the
form with the BackImage property. Any area not covered by the BackImage property
on the form will be black because you’ve used the BackColor property to simulate the
quiet melancholy of outer space.


  1. Click the Earth image several times to expand it on the screen.


After 10 or 11 clicks, your screen looks similar to this:

Because the image has a relatively low resolution, it will eventually become somewhat
blurry if you magnify it much more. You can address this limitation by saving smaller
images at a higher resolution. The wispy clouds on Earth mitigate the blurring problem
in this example, however. (In print, this will not look that great, so be sure to try it out
on your computer and see the image in color!)


  1. When you get close enough to establish a standard orbit, click the Close button to quit
    the program.
    The program stops, and the development environment returns.


One Step Further: Changing Form Transparency


Interested in one last special effect? With GDI+, you can do things that are difficult or even
impossible in earlier versions of Visual Basic. For example, you can make a form partially
transparent so that you can see through it. Let’s say you’re designing a photo-display
Free download pdf