Really really stuck on this one. (QBasic Question) 
Author Message
 Really really stuck on this one. (QBasic Question)



Quote:
> I've got a shape drawn on the screen (in screen mode 11) and I have
>text in various places around the shape (and some in the shape), what
>I need to do is have my program draw/write all the stuff on the
>screen, then give the option to print it out, and if it is to be
>printed, print the stuff that is on the screen. I can't figure that
>out.

There is a way to do this internally, without pressing
shift-printscreen. Can't tell you how, though...

Quote:
>  If I use just shift-print screen, it only prints the Horizontal
>lines of the shape, none of the vertical or Diagnal(SP?) lines. The
>text is printed out (although it's too big). I'm really pretty new to
>programing and may have bitten off more that I can chew but I don't
>want to stop this far along...

Did you load GRAPHICS.COM before executing your program?
This is required for printing graphics.

Marc van den Dikkenberg
-----------------------

http://www.*-*-*.com/ ~excel             -  Sci-Fi, Humour, etc.
http://www.*-*-*.com/ ~excel  -  Programming



Fri, 04 Sep 1998 03:00:00 GMT  
 Really really stuck on this one. (QBasic Question)
I believe that what you should do is type GRAPHICS when at the DOS Prompt.
 Then the use of Shift-Print SHOULD work.  I haven't done this in a while
so I'm no quite sure.

Josh Woolever


Quote:
Boniface) writes:

I've been trying to figure this one out for about a week and half now,
if anyone could help me I'd appreciate it tremendously..

 I've got a shape drawn on the screen (in screen mode 11) and I have
text in various places around the shape (and some in the shape), what
I need to do is have my program draw/write all the stuff on the
screen, then give the option to print it out, and if it is to be
printed, print the stuff that is on the screen. I can't figure that
out.
  If I use just shift-print screen, it only prints the Horizontal
lines of the shape, none of the vertical or Diagnal(SP?) lines. The
text is printed out (although it's too big). I'm really pretty new to
programing and may have bitten off more that I can chew but I don't
want to stop this far along...

 thanks,

Jim



Sat, 05 Sep 1998 03:00:00 GMT  
 Really really stuck on this one. (QBasic Question)


Quote:


>> I've got a shape drawn on the screen (in screen mode 11) and I have
>>text in various places around the shape (and some in the shape), what
>>I need to do is have my program draw/write all the stuff on the
>>screen, then give the option to print it out, and if it is to be
>>printed, print the stuff that is on the screen. I can't figure that
>>out.

>There is a way to do this internally, without pressing
>shift-printscreen. Can't tell you how, though...

    Re the above
    ++++++++++++

Taken from the QBASIC HELP FILE (God Bless Microsoft !)

Example:
    'Calls routine for printing the screen to a local printer.
    DIM a%(2)
    DEF SEG = VARSEG(a%(0))
    FOR i% = 0 TO 2
       READ d%
       POKE VARPTR(a%(0)) + i%, d%
    NEXT i%
    DATA 205, 5, 203  : ' int 5  retf  'Machine-language code
                                       'for printing screen.
    CALL ABSOLUTE(VARPTR(a%(0)))
    DEF SEG

Or in a language that supports call interrupt

    CALL INTERRUPT 5

Quote:

>>  If I use just shift-print screen, it only prints the Horizontal
>>lines of the shape, none of the vertical or Diagnal(SP?) lines. The
>>text is printed out (although it's too big). I'm really pretty new to
>>programing and may have bitten off more that I can chew but I don't
>>want to stop this far along...

>Did you load GRAPHICS.COM before executing your program?

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quote:
>This is required for printing graphics.

>Marc van den Dikkenberg
>-----------------------

>http://www.xs4all.nl/~excel             -  Sci-Fi, Humour, etc.
>http://pitel_lnx.ibk.fnt.hvu.nl/~excel  -  Programming

***********************************************************

***********************************************************


Sun, 06 Sep 1998 03:00:00 GMT  
 Really really stuck on this one. (QBasic Question)

Hello, Someone asked on how to print graphics to a printer in QB
I use this code heacily in my programs, it does the job quite well
enjoy....

DEFINT A-Z
     SUB DumpScr (DisplayType, PrinterType$) STATIC

     'Subroutine DumpScr.

     'Alan J. Fridlund, Ph.D., April-August, 1988.
     'Adapted from routine by Charles Petzold in PC Magazine,
     'Vol 6, No 2, Jan 27, 1987.
     'QuickBasic 4.0 Graphics or Text Screen Dumps to:
     '     Epson (EPS), IBM Proprinter (IBM), or HP LaserJet (HP)
printers.
     'Dumps graphics screens in landscape (sideways) mode.

     'DisplayType:
     '  0 = CGA 200x640 pixel mode (SCREEN 2).
     '  1 = EGA 200x640 pixel mode (SCREEN 8).
     '  2 = EGA 350x640 pixel mode (SCREEN 9).
     '  3 = VGA 480x640 pixel mode (SCREEN 11 or 12).
     '  4 = Text screens for all display types.

     'PrinterType$:
     '  "EPS" = Epson-compatible dot matrix printer.
     '  "IBM" = IBM Proprinter-compatible printer.
     '  "HPL" = Hewlett-Packard LaserJet printer w/ 75 dpi graphics.

     IF DisplayType = 0 OR DisplayType = 1 THEN BottomPixel = 199: NTAB
= 8
     IF DisplayType = 2 THEN BottomPixel = 349:  NTAB = 12
     IF DisplayType = 3 THEN BottomPixel = 479:  NTAB = 0

     Esc$ = CHR$(27)

     IF DisplayType = 4 THEN
     WIDTH LPRINT 80
     LPRINT STRING$(9, 13)                     'Center dump on page.
     FOR ROW = 1 TO 25
        FOR COL = 1 TO 80
           KIN$ = INKEY$: IF KIN$ = Esc$ THEN GOTO GraphEnd'Esc
terminates.
           CHARACTER = SCREEN(ROW, COL)
           CHAR$ = "-"                  'Substitute for unprintable
chars.
           IF CHARACTER > 31 AND CHARACTER < 126 THEN
              CHAR$ = CHR$(CHARACTER)
           END IF
           LPRINT CHAR$;
        NEXT
     NEXT
     END IF

     IF DisplayType < 4 AND (PrinterType$ = "EPS" OR PrinterType$ =
"IBM") THEN

      WIDTH LPRINT 255

graph.
      PIXEL400$ = Esc$ + CHR$(75) + CHR$(144) + CHR$(1)'400 pixels
perline.
      PIXEL350$ = Esc$ + CHR$(75) + CHR$(94) + CHR$(1)'350 pixels per
line.
      PIXEL480$ = Esc$ + CHR$(75) + CHR$(224) + CHR$(1)'480 pixels
perline.
      IF DisplayType < 2 THEN NPIXEL$ = PIXEL400$'CGA pixels
doubleprinted.
      IF DisplayType = 2 THEN NPIXEL$ = PIXEL350$
      IF DisplayType = 3 THEN NPIXEL$ = PIXEL480$
      NormSp$ = Esc$ + CHR$(65) + CHR$(12)            'Normal line
spacing.
      NarrSp$ = Esc$ + CHR$(65) + CHR$(8)'Narrow line spacing for
graphics.
      IF PrinterType$ = "IBM" THEN
         NormSp$ = NormSp$ + Esc$ + CHR$(50)
         NarrSp$ = NarrSp$ + Esc$ + CHR$(50)
       END IF
       LPRINT NarrSp$
       FOR COL = 0 TO 639 STEP 8
         LPRINT TAB(NTAB);
         LPRINT NPIXEL$;
         FOR ROW = BottomPixel TO 0 STEP -1
            KIN$ = INKEY$: IF KIN$ = Esc$ THEN GOTO GraphEnd
            BYTE = 0
            FOR PIXEL = 0 TO 7
              IF POINT(COL + PIXEL, ROW) > 0 THEN
                    BYTE = BYTE OR 2 ^ (7 - PIXEL)
              END IF
            NEXT
            LPRINT CHR$(BYTE);
            IF DisplayType < 2 THEN LPRINT CHR$(BYTE);
         NEXT                                        'CGA/lowres EGA
pixels
         LPRINT                                      'are
double-printed.
       NEXT
       LPRINT NormSp$;
     END IF

     IF DisplayType < 4 AND PrinterType$ = "HPL" THEN
       WIDTH LPRINT 255
       IF DisplayType < 2 THEN NPIXEL$ = Esc$ + "*p400x300Y"'Center
cursor.
       IF DisplayType = 2 THEN NPIXEL$ = Esc$ + "*p510x300Y"
       IF DisplayType = 3 THEN NPIXEL$ = Esc$ + "*p240x300Y"
       NPIXEL$ = NPIXEL$ + Esc$ + "*t75R" + Esc$ + "*r1A"'Start 75 dpi
mode
       LPRINT NPIXEL$
       IF DisplayType < 2 THEN NPIXEL$ = Esc$ + "*b50W" 'Expect xxW
pixels.
       IF DisplayType = 2 THEN NPIXEL$ = Esc$ + "*b44W"
       IF DisplayType = 3 THEN NPIXEL$ = Esc$ + "*b60W"
       FOR COL = 0 TO 639
          KIN$ = INKEY$: IF KIN$ = Esc$ THEN GOTO GraphEnd
          LPRINT NPIXEL$;
          FOR ROW = BottomPixel TO 0 STEP -8
             IF DisplayType < 2 THEN           'Separate point into 2
bytes
               HIBYTE = 0: LOBYTE = 0          ' for CGA/low-res EGA
modes.
               FOR PIXEL = 0 TO 7
                  IF POINT(COL, ROW - PIXEL) > 0 THEN
                    IF PIXEL <= 3 THEN

                      LOBYTE = LOBYTE OR 2 ^ ((3 - PIXEL) * 2) OR 2 ^
((4 - PIXEL) * 2 - 1)
                    END IF
                    IF PIXEL >= 4 THEN
                      HIBYTE = HIBYTE OR 2 ^ ((7 - PIXEL) * 2) OR 2 ^
((8 - PIXEL) * 2 - 1)
                    END IF
                  END IF
               NEXT
               BYT$ = CHR$(LOBYTE) + CHR$(HIBYTE)
               LPRINT BYT$;
             END IF
             IF DisplayType >= 2 THEN
               LOBYTE = 0
               FOR PIXEL = 0 TO 7
                  IF POINT(COL, ROW - PIXEL) > 0 THEN
                    LOBYTE = LOBYTE OR 2 ^ (7 - PIXEL)
                  END IF
               NEXT
               LPRINT CHR$(LOBYTE);
             END IF
          NEXT
       NEXT
     LPRINT Esc$; "*rB"; Esc$; "E"                  'Return to text
mode.
     END IF

GraphEnd:
     LPRINT CHR$(12);                                'Page eject.
     SOUND 1000, 1                                   'Signal
termination.
     WIDTH LPRINT 80

     END SUB

  ' ***********************************************
  ' **  Name:         Ega.HP                     **
  ' **  Type:         Program                    **
  ' **  Module:       HPDUMP.BAS                 **
  ' **  Language:     Microsoft QuickBASIC 4.x   **
  ' ***********************************************
  '
        SUB ega.hp STATIC

                EgaLength% = 28000                  ' size of EGA memory
                DEF SEG = &HA000                    ' EGA screen  
segment
                BSAVE "$TMP.TM1", 0, EgaLength%     ' BSAVE the screen
image

                e$ = CHR$(27)                       ' escape
                Hdr$ = e$ + "*t75R"                 ' 75 dpi resolution
                Hdr$ = Hdr$ + e$ + "*r1A"           ' initialize
graphics

                EgaData$ = SPACE$(EgaLength%)       ' room for screen
image
                DEF SEG                             ' reset segment
                BLOAD "$TMP.TM1", SADD(EgaData$)    ' BLOAD it into
EgaData$

                ' create new image file
                FileNo% = FREEFILE
                OPEN "$TMP.TM2" FOR RANDOM AS #FileNo% LEN = 86
                FIELD #FileNo%, 6 AS Start$, 80 AS Dat$

                LSET Start$ = e$ + "*b80W"          ' start graphics
command

                FOR x% = 1 TO EgaLength% STEP 80    ' data from original
file
                        LSET Dat$ = MID$(EgaData$, x%, 80)
                        PUT #FileNo%
                NEXT x%
                CLOSE #FileNo%

                LPRINT Hdr$;                        ' LPRINT the header
directl
                SHELL "COPY $TMP.TM2/B LPT1: >NUL:" ' copy the image
file to HP
                LPRINT e$; "*rB"; e$; "E";          ' end-of-graphics +
reset
                KILL "$TMP.TM?"                     ' delete temporary
files

        END SUB

Jeff Moser

- Message from {*filter*}space Realm. 28.8k bps dialups: (513)961-7214, (513)961-7215; Telnet: 204.248.144.249 (with your Excalibur terminal).  Visit us on the WWW at http://www.*-*-*.com/ !



Sat, 12 Sep 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. This is a really really dumb question.

2. HELP - Really, really simple printer questions

3. Really, really stupid question.

4. Really, Really Horrible question about sprites

5. Getting REALLY Stuck on Address Book

6. Really stuck on creating a WOrd document from ASP

7. I am really stuck here....

8. Word and ASPs...I really am stuck

9. Newbie stuck with really simple problem - Please help.

10. Really stuck!!

11. Please help Really Stuck!!!

12. really really long path names - phrogg

 

 
Powered by phpBB® Forum Software