program HowToDrawABitmap; uses SwinGame,sgTypes; procedure Main(); begin OpenGraphicsWindow('Draw Bitmap' ,800 ,600 ); ClearScreen(ColorWhite ); LoadBitmapNamed('rocket image' ,'rocket_large.png' ); DrawBitmap('rocket image' ,111 ,4 ); RefreshScreen(); Delay(5000 ); ReleaseAllResources(); end; begin Main(); end.
How To Draw A Bitmap
This beginner level how to shows you how a bitmap is drawn to the game window in SwinGame.
There are two main functions you will want to perform with images in SwinGame. SwinGame provides procedures to draw JPEG, PNG or TIFF file. To use an image in your SwinGame project move your file into the Resources/images sub folder. Then call the LoadBitmap function. Once you have loaded your bitmap, you can call DrawBitmap. Don't forget to call RefreshScreen to ensure your bitmap is visible in the game window.
SwinGame offers a number of other functions and procedures when working with images. Explore the Images API for alternate ways of loading and drawing Bitmaps to the game window.
Delay and refresh screen procedures can help you draw images at different times.
- Start by drawing a single picture to the screen
- Try drawing it multiple times, in different locations
- Test out drawing different images
- You can make your own album or a storyboard
- A slideshow with images and texts
- Your very own interactive comic book