Part One - Load Images
DarkBASIC Professional supports the following image formats, .DDS, .JPG, .BMP, .PNG, and .DIB. Loading the image itself is fairly simple using the LOAD BITMAP function as shown below.
Example:
LOAD BITMAP "path\to\my\image\myimage.jpg", 12
You will need to supply a number as the second parameter. You will be able to refer to this reference number in the future when you want to do something with that specific image.
If you need to, later on, you can delete or even copy a bitmap using two built in commands. To delete a previously loaded bitmap use the DELETE BITMAP command. Make sure to give the desired bitmaps number as a parameter.
To copy a bitmap you will need a bitmap to copy and a bitmap to paste it over or into, so make sure to create two bitmaps first. Use the COPY BITMAP command and supply the source bitmaps number as the first parameter and the destination bitmaps number as the second parameter.
Part Two - Manipulating Images
There are four different built in commands to manipulate a bitmap once it is loaded. FLIP BITMAP, MIRROR BITMAP, FADE BITMAP, and BLUR BITMAP.
To flip an image or bitmap vertically use the FLIP BITMAP command. Make sure to give your desired images reference number as a parameter so DarkBASIC Pro knows which bitmap to actually flip.
The MIRROR BITMAP function will mirror the specified bitmap or image horizontally. This function, basically, is the horizontal version of the FLIP BITMAP command shown above. You will need to supply the desired image number as a parameter.
Fading an image in DarkBASIC Pro is accomplished by calling the FADE BITMAP command. The first parameter to the fade command is your desired bitmaps number. The second parameter is a number or integer between 1 and 100. This value will set how much of the image to fade. This function could be combined with timer for a nice fading visual effect.
End
Putting these simple and easy to use functions and commands into practice in your project should put you on the right start when building you game or application using DarkBASIC Professional.
Published by James Cloud
I like to program and do basically anything that has to do with technology and computers. View profile
- How to Write for a Professional MagazineThere are professional magazines for nearly every career choice in the world; if you have extensive knowledge of a particular profession, this could be your market. Unfortunately, professional magazines have extremely...
- The Difference Between Vector Files and Bitmap FilesVector files and bitmap files and the real world difference
- Professional Make-Up TipsWhatever the reason, there are days when every woman looks into her mirror and doesn't like what she sees. Understanding basic cosmetics can help but so can these professional tips and tricks.
- Using Images in Web PagesImages are very useful in web page layout and design. They add color to and enhance the appeal of a web page. Images can, however, take long to load. Care should therefore be taken to ensure that images are used well...
- Images in the Current MediaThis article will focus on the images in the media portrayed to appeal to the vast audience of teenagers, how they are affected by, and how images can be negative and positive.
- How to Dress Like a Professional Working Man
- The Oral B Professional Care 9400 Triumph is a Triumph
- Font Editor Programs
- 10 Tips to Make Your Home Based Business Look Professional
- Accounting Continuing Professional Education
- The Disgraceful State of Professional Sports
- How to Give Your Home Business a Professional Image



