Graphics VB2008 Pro

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Galen Somerville

    Graphics VB2008 Pro

    My graphics involves a lot of line drawings in a short period of time. I
    have all the graphics in a separate module.

    I repeatedly get the pixel data from a USB device, draw the requisite
    traces, get more data, draw traces, etc.

    The USB appears to take 82 ms between bursts of data. But the drawing is
    taking 178 ms !!!

    It's a real time display, like an oscilloscope, whereby I have to blank the
    current 6 pixels, draw the new data in those 6 pixels then blank the next 6
    pixels (to leave a gap that shows the traces moving across the screen).

    By 6 pixels I mean horizontally. The lines represented by these 6 pixels can
    have vertical pixels of, say, 50 pixels above and below an imaginary center
    line. At the end of a full screen sweep, the current array info is saved to
    a previous array so all the data is available.

    Rather than post my code here, I have placed all the module info on my web
    site. I would appreciate it if someone with mucho more knowledge than I
    could take a look at it.



    Thanks

    Galen


  • Spam Catcher

    #2
    Re: Graphics VB2008 Pro

    "Galen Somerville" <galen@communit y.nospamwrote in news:#o9WfIlcIH A.4476
    @TK2MSFTNGP06.p hx.gbl:
    My graphics involves a lot of line drawings in a short period of time. I
    have all the graphics in a separate module.
    >
    I repeatedly get the pixel data from a USB device, draw the requisite
    traces, get more data, draw traces, etc.
    Have you looked at using WPF to do your graphics?

    --
    spamhoneypot@ro gers.com (Do not e-mail)

    Comment

    • Galen Somerville

      #3
      Re: Graphics VB2008 Pro


      "Spam Catcher" <spamhoneypot@r ogers.comwrote in message
      news:Xns9A48811 257835usenethon eypotrogers@127 .0.0.1...
      "Galen Somerville" <galen@communit y.nospamwrote in news:#o9WfIlcIH A.4476
      @TK2MSFTNGP06.p hx.gbl:
      >
      >My graphics involves a lot of line drawings in a short period of time. I
      >have all the graphics in a separate module.
      >>
      >I repeatedly get the pixel data from a USB device, draw the requisite
      >traces, get more data, draw traces, etc.
      >
      Have you looked at using WPF to do your graphics?
      >
      --
      spamhoneypot@ro gers.com (Do not e-mail)
      No, I'll look into that

      Galen


      Comment

      • Galen Somerville

        #4
        Re: Graphics VB2008 Pro


        "Galen Somerville" <galen@communit y.nospamwrote in message
        news:%23VWMXelc IHA.2268@TK2MSF TNGP02.phx.gbl. ..
        >
        "Spam Catcher" <spamhoneypot@r ogers.comwrote in message
        news:Xns9A48811 257835usenethon eypotrogers@127 .0.0.1...
        >"Galen Somerville" <galen@communit y.nospamwrote in
        >news:#o9WfIlcI HA.4476
        >@TK2MSFTNGP06. phx.gbl:
        >>
        >>My graphics involves a lot of line drawings in a short period of time. I
        >>have all the graphics in a separate module.
        >>>
        >>I repeatedly get the pixel data from a USB device, draw the requisite
        >>traces, get more data, draw traces, etc.
        >>
        >Have you looked at using WPF to do your graphics?
        >>
        >--
        >spamhoneypot@ro gers.com (Do not e-mail)
        >
        No, I'll look into that
        >
        Galen
        >
        >
        Does anyone have a link to a simple VB.net module using WPF in 2D (drawing
        lines).

        All that I find are written in C variations.

        Galen


        Comment

        • Walter Wang [MSFT]

          #5
          Re: Graphics VB2008 Pro

          Hi Galen,

          If you're looking for WPF samples, you can find many of them in the Windows
          SDK
          (http://www.microsoft.com/downloads/d...E300-F358-4523
          -B479-F53D234CDCCF&di splaylang=en) or your can search for them on
          http://msdn2.microsoft.com and http://windowsclient.net

          However, if this issue is still the previous one we have discussed long
          time ago, remember managed code will probably never draw faster than low
          level APIs such as DirectX.

          Regards,
          Walter Wang (wawang@online. microsoft.com, remove 'online.')
          Microsoft Online Community Support

          =============== =============== =============== =====
          When responding to posts, please "Reply to Group" via your newsreader so
          that others may learn and benefit from your issue.
          =============== =============== =============== =====

          This posting is provided "AS IS" with no warranties, and confers no rights.

          Comment

          • Galen Somerville

            #6
            Re: Graphics VB2008 Pro

            Hi Walter

            Yes it's the same problem. We originally solved the problem of a very slow
            USB by using shared memory and activex.

            I thought I would try VB2008 Pro but the slow drawing is still the problem.
            After looking into WPF I got the impression it would be much faster than the
            current graphics methods.

            If this is not true then maybe I should look at shared memory and activex
            for the drawing portion?

            Incidentally I made a minor change in my VB6 app and now I can process Heart
            beats well over 450 per minute whereas I was getting only around 300 tops.
            This puts us in the realm of animals and birds.

            Galen

            ""Walter Wang [MSFT]"" <wawang@online. microsoft.comwr ote in message
            news:inUDGNqcIH A.4720@TK2MSFTN GHUB02.phx.gbl. ..
            Hi Galen,
            >
            If you're looking for WPF samples, you can find many of them in the
            Windows
            SDK
            (http://www.microsoft.com/downloads/d...E300-F358-4523
            -B479-F53D234CDCCF&di splaylang=en) or your can search for them on
            http://msdn2.microsoft.com and http://windowsclient.net
            >
            However, if this issue is still the previous one we have discussed long
            time ago, remember managed code will probably never draw faster than low
            level APIs such as DirectX.
            >
            Regards,
            Walter Wang (wawang@online. microsoft.com, remove 'online.')
            Microsoft Online Community Support
            >
            =============== =============== =============== =====
            When responding to posts, please "Reply to Group" via your newsreader so
            that others may learn and benefit from your issue.
            =============== =============== =============== =====
            >
            This posting is provided "AS IS" with no warranties, and confers no
            rights.
            >

            Comment

            • Walter Wang [MSFT]

              #7
              Re: Graphics VB2008 Pro

              Hi Galen,

              I agree doing animation in WPF would be better than in Winform. Based on
              your actual scenario, you may have a try and see if it meets your
              requirement.

              I'm not sure how the shared memory would help the drawing part.

              Regards,
              Walter Wang (wawang@online. microsoft.com, remove 'online.')
              Microsoft Online Community Support

              =============== =============== =============== =====
              When responding to posts, please "Reply to Group" via your newsreader so
              that others may learn and benefit from your issue.
              =============== =============== =============== =====

              This posting is provided "AS IS" with no warranties, and confers no rights.

              Comment

              • Galen Somerville

                #8
                Re: Graphics VB2008 Pro

                I'm currently setting up a WPF User control. We'll see what happens.

                Galen

                ""Walter Wang [MSFT]"" <wawang@online. microsoft.comwr ote in message
                news:ynEKHz1cIH A.5204@TK2MSFTN GHUB02.phx.gbl. ..
                Hi Galen,
                >
                I agree doing animation in WPF would be better than in Winform. Based on
                your actual scenario, you may have a try and see if it meets your
                requirement.
                >
                I'm not sure how the shared memory would help the drawing part.
                >
                Regards,
                Walter Wang (wawang@online. microsoft.com, remove 'online.')
                Microsoft Online Community Support
                >
                =============== =============== =============== =====
                When responding to posts, please "Reply to Group" via your newsreader so
                that others may learn and benefit from your issue.
                =============== =============== =============== =====
                >
                This posting is provided "AS IS" with no warranties, and confers no
                rights.
                >

                Comment

                • Galen Somerville

                  #9
                  Re: Graphics VB2008 Pro

                  It's not just 6 pixels. From horizontal pixel 1 to horizontal pixel 2 may
                  have a difference of 100 vertical pixels.

                  And first it has to erase the previous trace between those 6 X pixels and
                  all of their Y components. Then it has to draw the new trace for those 6
                  pixels, etc.

                  Galen

                  <Just_a_fan@hom e.netwrote in message
                  news:dqvgs3pnpl akpom73jcpa8qba igauvli10@4ax.c om...
                  That's a really long time to draw 6 pixels.
                  >
                  Are you referencing the previous data and only turning off the pixel
                  that was on or are you blanking the entire column?
                  >
                  No, I did not download the code. Just a quick thought I had when I read
                  your post.
                  >
                  Mike
                  >
                  On Mon, 18 Feb 2008 09:16:28 -0800, in
                  microsoft.publi c.dotnet.langua ges.vb "Galen Somerville"
                  <galen@communit y.nospamwrote:
                  >
                  >>My graphics involves a lot of line drawings in a short period of time. I
                  >>have all the graphics in a separate module.
                  >>
                  >>I repeatedly get the pixel data from a USB device, draw the requisite
                  >>traces, get more data, draw traces, etc.
                  >>
                  >>The USB appears to take 82 ms between bursts of data. But the drawing is
                  >>taking 178 ms !!!
                  >>
                  >>It's a real time display, like an oscilloscope, whereby I have to blank
                  >>the
                  >>current 6 pixels, draw the new data in those 6 pixels then blank the next
                  >>6
                  >>pixels (to leave a gap that shows the traces moving across the screen).
                  >>
                  >>By 6 pixels I mean horizontally. The lines represented by these 6 pixels
                  >>can
                  >>have vertical pixels of, say, 50 pixels above and below an imaginary
                  >>center
                  >>line. At the end of a full screen sweep, the current array info is saved
                  >>to
                  >>a previous array so all the data is available.
                  >>
                  >>Rather than post my code here, I have placed all the module info on my web
                  >>site. I would appreciate it if someone with mucho more knowledge than I
                  >>could take a look at it.
                  >>
                  >>http://home.surewest.net/galen/private/PictDraw.zip
                  >>
                  >>Thanks
                  >>
                  >>Galen
                  >>
                  >

                  Comment

                  Working...