text printing in a graphics screen with control of fore and back colors 
Author Message
 text printing in a graphics screen with control of fore and back colors

The following routine will print text on a graphics screen.  You have control
of the foreground and background colors.  The routine can be included in any
basic program.  Pass the parameters as specified and voila!  Note that the
background color is just for the characters in the text.  You have to include
the correct library or quicklibrary as well.  I beleive its qb.qlb or qb.lib
for QuickBasic 4.5 and qbx.qlb or qbxqlb.lib for BAsic 7.0 and 7.1  (I might
be wrong, Its the library with support for Call Interrupt and Call InterruptX)

Go crazy

SUB graphicstext (text$, row%, col%, forecol%, backcol%) STATIC
c$ = STRING$(LEN(text$), 219)

Registers.ax = &H1300
Registers.bx = bc%
Registers.cx = LEN(text$)
Registers.dx = 256 * (row% - 1) + (col% - 1)
Registers.es = SSEG(c$)
Registers.bp = SADD(c$)
CALL InterruptX(&H10, Registers, Registers)

Registers.bx = (forecol% XOR backcol%) + &H80
Registers.es = SSEG(text$))
Registers.bp = SADD(text$)
CALL InterruptX(&H10, Registers, Registers)


Rick Burke

TH-Th-Th-thats all folks.

Tue, 11 Feb 1997 05:10:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Change BMP Back Color and Fore Color

2. Change Control Fore & Back Color w/API

3. Multiple Text Colors / Fore Colors In A VB4 Text Box

4. Getting Char, fore/back color?

5. ListView back & fore colors

6. fore and back color in commandbuttons

7. ComboBoxEx Back and Fore Color

8. Want Disabled Text Field's Fore Color to be Black Instead of Gray

9. Print text to SCREEN 12 in any color combination

10. Setting ssTab Control Fore Colors, Urgent Help Needed Please

11. How can I Customize the back/fore color of selected text in TextBox....

12. Printing text and graphics: text appears completely black


Powered by phpBB® Forum Software