• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

So I'm using this thingie called PSET...

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

    #11
    First, you need to set the AutoRedraw property to True before you do the drawing - the system then knows to keep track of what you draw. Otherwise, it expects you to have a Paint event handler that will redraw it every time.

    You can check if this is the problem by hiding the window behind another window and then bringing it to the front again - if the PictureBox isn't redrawn, then change the code to set AutoRedraw before drawing, and try again - it should now work as expected.

    (The hide/show test may also be graphics-driver-dependant, so do the AutoRedraw thing even if it seems unnecessary after the first hide/show test.)

    If that's working but it's still not saving correctly, try changing
    Code:
    SavePicture frmWfaxdisp.picDisplay.Picture, filetosave
    to
    Code:
    SavePicture frmWfaxdisp.picDisplay.Image, filetosave
    and see if that works.

    Finally, some people claim that setting the PictureBox's Picture property to the value of its Image property will work, but that sounds a bit voodoo chicken to me - also, the VB docs seem to suggest that the Picture property is read-only at runtime. But if all the above fails, give that a try - revert the change to the SavePicture call as well if you try this.

    Comment


      #12
      Danke.

      I shall try that tomorrow.

      I frigged about with that image thingie last week to no great avail... but then I don't know what I'm doing anyway...

      I loaded up my, er, "copy" of VB3 pro today, coz it's got the MSCOMM thingie in it...

      I've hacked about with the VBTERM example & have it writing stuff to a Picture that I've added.

      It actually shows the range of the pll chip is quite limited, I may have to shift some bits in the PIC to restore it to something more applicable.

      Or alternatively, I may attempt to use the external VRef I designed onto the board...



      Originally posted by NickFitz View Post
      First, you need to set the AutoRedraw property to True before you do the drawing - the system then knows to keep track of what you draw. Otherwise, it expects you to have a Paint event handler that will redraw it every time.

      You can check if this is the problem by hiding the window behind another window and then bringing it to the front again - if the PictureBox isn't redrawn, then change the code to set AutoRedraw before drawing, and try again - it should now work as expected.
      Yup.

      Did that, it now redraws ok... still doesn't save the image though...

      I'm onto the next suggestion now, with the .Image thingie instead of the .Picture thingie...

      This is so exciting...


      Yes! Yes! Yes!.... the .Image thing does the business...

      Muchos gracias...
      Last edited by zeitghost; 15 June 2017, 08:01.

      Comment


        #13
        Originally posted by zeitghost
        Muchos gracias...
        HTH

        You'd never guess that I've never done any VB programming, would you

        Comment


          #14
          Originally posted by NickFitz View Post
          HTH

          You'd never guess that I've never done any VB programming, would you
          Tell Bob and the rest of the Mumbai posse well done
          "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

          Comment


            #15
            Originally posted by NickFitz View Post
            HTH

            You'd never guess that I've never done any VB programming, would you



            Not really, no... it seemed your usual sort of now you mention it...



            I'm moving on now to the 4046 PLL setup, coz it's set for a centre frequency of about 4.5kHz, which is far too high.

            I shall have to redimension things a bit... to bring it down to say 2.5kHz...



            Well, I've done that & it does appear to receive stuff...

            After much frigging around with pixel counts, it displays stuff.

            Oddly, the timing seems very variable... I can't decide if VB is dropping characters or if the PIC16F88 is sampling randomly... I find it difficult to believe that the pic could be as far out as it looks on the screen... but I may well be wrong there.


            It is indeed very odd... if I make the display window larger, the timing goes all to pot...

            How weird is that?


            Down to the speed of the pc, I've migrated the code on a floppy over to a slightly faster machine & the scan rate doesn't change any more.

            Since it's running XP, however, the serial handling seems to have slowed to a crawl...
            Last edited by zeitghost; 15 June 2017, 08:00.

            Comment


              #16
              I gave a load of old books including a beginner's guide to VB3 to the Barnardo's charity shop last year. If you hurry Z it may still be there.
              bloggoth

              If everything isn't black and white, I say, 'Why the hell not?'
              John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

              Comment


                #17
                Originally posted by xoggoth View Post
                I gave a load of old books including a beginner's guide to VB3 to the Barnardo's charity shop last year. If you hurry Z it may still be there.
                Thanks, Xogg, I'll pop along tomorrow morning. Probably gone though...

                Comment

                Working...
                X