Problem:
This demo shows you how can you place a bitmap as a background on your windows. This demo uses bitmaps of 16 colours, 256 colours and 24 bits colours.
Resolution:
INTRODUCTION
==========
This demo shows you how can you place a bitmap as a background on your windows. This demo uses bitmaps of 16 colours, 256 colours and 24 bits colours.
SOURCE FILES:
=========
Program Files Description
--------------------- -----------------------------------------------------------
bitmapdemo.cbl Simple COBOL program that loads bitmapdemo.gs
Copy Files:
--------------------- -----------------------------------------------------------
bitmapdemo.cpb copy file generated with Dialog System.
Resource Files:
--------------------- -----------------------------------------------------------
bitmaps.rc bitmap resource file used to create bitmaps.dll. Only used for the 16 colour
bitmap
bitmapdemo.gs Dialog System screenset.
bitmaps.icn Dialog System resource file that allows the bitmaps to be used within the
screenset.
boat50pc16.bmp 16 colours bitmap.
boat50pc256.bmp 256 colours bitmap.
boat50pc24b.bmp 24 bit colours bitmap.
REQUIREMENTS:
==========
Dialog System needs to be installed.
OPERATION:
========
To build the project select Project / Rebuild To run the project select Animate / Run.
Steps to create this demo
1) NE IDE menu: File / New / Program
2) Save as Bitmaps.rc
3) Enter the following file contents
204 BITMAP boat50pc16.bmp
4) Save and close bitmaps.rc
5) NE IDE menu: Project / Add files to project / enter bitmaps.rc
bitmaps.rc is added in the right hand side panel and bitmaps.dll is added in the left hand side
panel.
6) NE IDE menu: Project / Rebuild : bitmaps.dll is created
7) NE IDE menu: File / New / Program
8) File / Save As : bitmaps.icn (Dialog System resource side file)
9) Enter the following contents:
[win-bitmaps] background : bitmaps.dll 204
10) NE IDE menu: Project / Add files to project / enter bitmaps.icn bitmaps.icn is added at the left and right panels
11) Open your Dialog System screenset.
12) Dialog System menu: Options / Resource files Enter bitmaps.icn in the Icon/Bitmap file entryfield.
13) To add the bitmap in a window, click on the bitmap object (the camera). Select the desired bitmap. In this case it would "background". Position it in the Window.
14) To see the objects in the window, right click on the bitmap and select "Send to back".
NOTE: All the text in the window will be covered by the bitmap. If you need to position text in the window in a way that is not covered by the bitmap, the way to do it is by adding an entryfield with no masterfield, a PIC big enough to hold the text, the "Display" property and the text required as "Initial text".
These steps will allow you to position a 16 colour bmp in the window. If you want to add a 256 colour bitmap, you need to follow the following steps:
1) Edit your bitmaps.icn file
2) Add the following contents:
[win-bitmaps] ... background2 : boat50pc256.bmp
3) NE IDE menu: Project / Add files to project / enter boat50pc256.bmp boat50pc256.bmp is added at the left and right panels
4) NE IDE menu: Project / Properties / - click on Application Enter MFDSSW in Variable Enter /B2 in Value click on Set, OK - click on IDE Enter MFDSSW in Variable Enter /B2 in Value click on Set, OK Setting MFDSSW in both IDE and application ensures that the environment variable is set when you run the Dialog System tool and when you run your application even if you run it outside of the NE IDE (if you link it to an .exe, if you leave it in .int, .gnt or .dll format you will have to set it manually).
5) Open your Dialog System screenset.
6) Ensure that bitmaps.icn is defined in Dialog System menu: Options / Resource files
7) To add the bitmap in a window, click on the bitmap object (the camera). Select the desired bitmap. In this case it would "background2". Position it in the Window.
8) To see the objects in the window, right click on the bitmap and select "Send to back".
REFERENCES
========
For more information about adding bitmaps to your Dialog System screenset please refer to the Net Express on line help, Contents tab, Programming, User Interface Programming, Dialog System, Bitmaps, Icons and Mouse Pointers.
==========================================================
Keywords: demonstration, sample, example, demo, Dialog System, bitmapdemo.zip
demo.ex
demo.ne