Announcement

Collapse
No announcement yet.

Graphic Print isn't working for me

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Graphic Print isn't working for me

    Hi all,

    I have no idea why this doesn't work. Maybe someone can spot the problem. It's got to be something simple, right?

    What it does is show the first graphic print "Test 1: 1.0" but nothing else. I've tried a dialog redraw setup as well which is even worse. Nothing shows.

    The box however, always shows. I put that in there to see if it was every graphic statement. Only print and line input (which isn't shown here) have this problem. They are invisible after the first print.

    I'm stuck.

    Randal

    Code:
    $Version = "1.0"
    
    Function PBMain()
      Graphic Window "Greatest Thing Since Sliced Onions" & $VERSION, 0, 0, 1024, 768 To hWin
      Graphic Attach hWin, 0
      font new "Lucida Console", 12, 0, 0, 0, 0 to font1
      graphic set font font1
      Graphic Color %RGB_LIME, 0
      GRAPHIC CLEAR %BLACK
    
      graphic Print "Test 1: "; $Version
      graphic Print " "
      graphic Print "Test 2"
      graphic box (100, 100) - (220, 220), 0, %BLUE, 0
      graphic waitkey$
    end function

  • #2
    Works for me PB 9.01 and Vista... but I did have to add the following statement at the top of PBMain().

    LOCAL hwin, font1 AS LONG

    Comment


    • #3
      After Charles mod, works straight off with CC501. What version of PB are you using?
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.

      Comment


      • #4
        Weird, maybe it is my graphics card.

        I'm using version 9.01 and I do have hWin and font1 defined as global because I'll be using other subroutines. I forgot to copy and paste those.

        Thanks, for trying it out and letting me know it works for someone else. I could update my drivers but my Virtual Reality system needs the ones I have on here. nVidia broke it in their later versions and has no plans to fix it.

        Can anyone suggest a workaround, maybe something else besides Graphics Print?

        Thanks,

        Randal

        Comment


        • #5
          Randal:

          Woks fine in PB9.01
          May be you can try with a different font

          Code:
           
          $Version = "1.0"
           
          FUNCTION PBMAIN()
            LOCAL hWIN AS LONG, font1 AS LONG
            GRAPHIC WINDOW "Greatest Thing Since Sliced Onions" & $VERSION, 0, 0, 1024, 768 TO hWin
            GRAPHIC ATTACH hWin, 0
            FONT NEW "Lucida Console", 12, 0, 0, 0, 0 TO font1
            GRAPHIC SET FONT font1
            GRAPHIC COLOR %RGB_LIME, 0
            GRAPHIC CLEAR %BLACK
            GRAPHIC PRINT "Test 1: "; $Version
            GRAPHIC PRINT " "
            GRAPHIC PRINT "Test 2"
            GRAPHIC BOX (100, 100) - (220, 220), 0, %BLUE, 0
            GRAPHIC WAITKEY$
          END FUNCTION
          Regards,
          Last edited by Manuel Valdes; 8 Oct 2009, 04:06 PM.

          Comment


          • #6
            Randal:

            The problem is related to the LINE INPUT statement. I added that line and the problem happens.
            Are you sure you are using "GRAPHIC" LINE INPUT?

            Regards,
            Last edited by Manuel Valdes; 8 Oct 2009, 04:56 PM.

            Comment


            • #7
              Originally posted by Manuel Valdes View Post
              Randal:

              The problem is related to the LINE INPUT statement. I added that line and the problem happens.
              Are you sure you are using "GRAPHIC" LINE INPUT?

              Regards,
              I should have stated that in my last post but yes, I am definitely using GRAPHIC LINE INPUT.

              What makes things even more interesting (for me anyway) is that I can add a control graphic [CONTROL ADD GRAPHIC] and then attach to it instead and it will display everything. But now any input (GRAPHIC LINE INPUT, GRAPHIC INPUT, GRAPHIC INKEY$, GRAPHIC WAITKEY$) locks it up. I can close it by clicking the X in the corner but it stays live where I have to kill the process itself through the task manager.

              I upgraded to PB 9.02 a few minutes ago without a difference. I can understand if it is my graphics card that is causing the display issue, however, the input shouldn't be a problem with a graphic control.

              Randal

              Comment


              • #8
                Randal:

                Just to get some new lines of thinking:

                Can you post the Model of your NVidia Graphic card?

                Did you try commenting the Font New and the Graphic Set font lines, so the program run with de default Font?

                Are you using some predifined Equate as a Promt in your GRAPHIC LINE INPUT statement?

                Are you aware that if you attach any other graphic object, the program automatically detach the Graphic Window, so you have to attach it again?

                Best regards,

                Comment


                • #9
                  I haven't tried the code but have you tried the REDRAW option?
                  Rod
                  In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                  Comment


                  • #10
                    Randal,

                    It would help if you would post Compilable Examples that illustrate the problems you see on your computer.
                    That can show a bigger picture (are Register variables being used etc).

                    The code you posted doesn't actually compile without mods but once declarations for the variables are added, it seems to run fine for other users..

                    The recent upgrade to 9.02 does fix a problem that could occur when WaitKey$ was active in a Graphic Window program, if that window was closed with the [X] button on the caption bar. (Previously Task Manager had to be used to kill the process).
                    Rgds, Dave

                    Comment


                    • #11
                      Hi Dave,

                      The code that I posted, with the exception of the two global variables which someone pointed out a few days ago, is the crux of it. That's the very first thing. I've stripped it down to bare minimum.

                      My graphics card is a GeForce 7600 GS running driver 91.31 which is somewhat dated now I know but as I stated earlier, nVidia broke the stereoscopic functionality in later versions with no plans to fix it. They've licensed themselves with some monitor making company and that's about the only thing that works on it with the exception of anaglyph (red/blue glasses). Since I have over a thousand dollars invested in VR equipment I'd hate to scrap it.

                      Rodney, I tried the redraw. It actually makes everything blank now. Good suggestion, keep the ideas flowing.

                      Manuel:
                      Can you post the Model of your NVidia Graphic card?

                      Did you try commenting the Font New and the Graphic Set font lines, so the program run with de default Font?

                      Are you using some predifined Equate as a Promt in your GRAPHIC LINE INPUT statement?

                      Are you aware that if you attach any other graphic object, the program automatically detach the Graphic Window, so you have to attach it again?
                      I'm going to try the default font now. There is no equate as a prompt. It is simply a "> ".

                      I am aware of the attaching thing detaching previous things. Unfortunately I haven't even gotten that far yet. The Graphic Line Input is where the Graphic WaitKey$ was. I was trying several ways to pause the screen until I'm ready to go to the next section which isn't called at this time.

                      I appreciate all the suggestions. It is giving me food for thought and making me double check my code which is a good thing.

                      [Edit] I just tried the default font and I can see the text now. The screen is showing gray but the letters are green on black.

                      Thanks,

                      Randal
                      Last edited by Randal Lanning; 10 Oct 2009, 01:30 PM. Reason: Did a test with the default font.

                      Comment


                      • #12
                        You might try changing:
                        Code:
                         GRAPHIC COLOR %RGB_LIME, 0
                        to:
                        Code:
                         GRAPHIC COLOR %RGB_LIME, -2
                        or:
                        GRAPHIC COLOR %RGB_LIME
                        I got a subtle difference when I tried this, even though it worked with the 0.
                        Last edited by Rodney Hicks; 11 Oct 2009, 11:13 AM.
                        Rod
                        In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                        Comment


                        • #13
                          Randal:

                          I think your code is bullet proof. I have worked a good deal with Graphics Windows and can see nothing possibly wrong.

                          Regarding the graphic card, unfortunatelly the closest thing I have is a PC fitted with a GEForce 5200 model, and there it works fine.

                          May be the problem has to do with memory. As far as I know those graphic cards are quite memory-hungry, requiring a good byte from the system's.

                          Best regards,

                          Comment

                          Working...
                          X