by grigri (9 Submissions)
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (13 Votes)
This program takes a bitmap image and applies a bevel effect to it, adding hilights and shadows to make it appear 3-D.
The direction and elevation of the light can be changed, as can the size of the bevel.
Includes a "debug" mode which shows the process step-by-step (see screenshot)
Some of the calculations have been converted to integer calculations for speed. Others still use floating-point, this is one future optimization that I might do.
Assumes
The code uses the cDibBitmap class for www.vbaccelerator.com
Side Effects
Error checking is minimal.