'===========================================================================
' Subject: Producing a Color Gradient         Date: 10-19-03 (  :  )       
'  Author: Fred Buffington                    Code: PBDLL                  
'  Origin: oasys@sbcglobal.net              Packet: HTML.ABC
'===========================================================================
'Fred Buffington
'oasys@sbcglobal.net

'A "gradient" is for example the blue->black screens that are 
'used by many win Setup routines. 

'This is for DDT. 

'Edit a BMP with a paint program 
'1 x 2 pixels 
'Top pixel light blue 
'Bottom pixel black or dark blue. 

'Add the name to an RC file and make it into a PBR 
'in your program 

'#resource "myPBR.PBR" 
'(where the myPBR.PBR is the name your PBR file) 

'Dialog new ..... 0,0,x2,y2... 
'control add imagex, hDlg, %BKGND, "BMPCODE",0,0,x2,y2 

'(where %BKGND is the controls ID # and BMPCODE is the 
'code to access the BMP from the PBR file) 

'Example RC file 
'BMPCODE BITMAP GRDBKG.BMP 


#compile exe 
#include "win32api.inc" 
#resource "test.pbr" 
GLOBAL hDLG as LONG 
callback function dlgproc 
SELECT CASE CBMSG 
CASE %WM_COMMAND 
SELECT CASE CBCTL 
CASE 102 
DIALOG END CBHNDL,0 
END SELECT 
END SELECT 
END FUNCTION 

FUNCTION PBMAIN 
DIALOg NEW,0,"TEST",00,250,250 TO HDLG 
CONTROL ADD IMAGEX,hDlg,101,"BG",0,0,250,250 
CONTROL ADD BUTTON,hDLg,102,"OK",50,220,30,20 
DIALOG SHOW MODAL hDLG cal DLGPROC 
END FUNCTION 
