Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. gdi+ slow

gdi+ slow

Scheduled Pinned Locked Moved C#
graphicsgame-devquestionwinformshardware
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bwagz
    wrote on last edited by
    #1

    Hi, This might be a stupid question, but is it possible to incorporate directx/opengl into say a data acquisition application? i've pretty much tried every technique possible from double buffering to more efficient screen invalidating but the refresh speed is way to slow. So I was wondering if there is a way to include hardware acceleration into a win app. thanks, Brian

    J A 2 Replies Last reply
    0
    • B bwagz

      Hi, This might be a stupid question, but is it possible to incorporate directx/opengl into say a data acquisition application? i've pretty much tried every technique possible from double buffering to more efficient screen invalidating but the refresh speed is way to slow. So I was wondering if there is a way to include hardware acceleration into a win app. thanks, Brian

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Yes, of course. I've read about some apps that use Managed DirectX to do rendering; it's certainly possible, however you don't get the native look and feel of the standard Windows widgets. I suggest looking into Managed DirectX or Tao OpenGl.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango

      B 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Yes, of course. I've read about some apps that use Managed DirectX to do rendering; it's certainly possible, however you don't get the native look and feel of the standard Windows widgets. I suggest looking into Managed DirectX or Tao OpenGl.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango

        B Offline
        B Offline
        bwagz
        wrote on last edited by
        #3

        so when you say that i wouldn't get the native look and feel, does that mean the screen would blank out similiar to when running a video game?

        J 1 Reply Last reply
        0
        • B bwagz

          so when you say that i wouldn't get the native look and feel, does that mean the screen would blank out similiar to when running a video game?

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          No. I mean that, for instance, if you wanted a TreeView control, you'll have to write your own treeview control, because DirectX doesn't draw these for you, you'd have to draw them yourself. And if you're drawing them yourself, they probably won't look exactly like they do in standard Windows applications.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango

          B 1 Reply Last reply
          0
          • J Judah Gabriel Himango

            No. I mean that, for instance, if you wanted a TreeView control, you'll have to write your own treeview control, because DirectX doesn't draw these for you, you'd have to draw them yourself. And if you're drawing them yourself, they probably won't look exactly like they do in standard Windows applications.

            Tech, life, family, faith: Give me a visit. I'm currently blogging about: Conversation With a Muslim Judah Himango

            B Offline
            B Offline
            bwagz
            wrote on last edited by
            #5

            oh great....i'll def look into it, thanks :)

            1 Reply Last reply
            0
            • B bwagz

              Hi, This might be a stupid question, but is it possible to incorporate directx/opengl into say a data acquisition application? i've pretty much tried every technique possible from double buffering to more efficient screen invalidating but the refresh speed is way to slow. So I was wondering if there is a way to include hardware acceleration into a win app. thanks, Brian

              A Offline
              A Offline
              Anthony Baraff
              wrote on last edited by
              #6

              What are you actually trying to do that is causing refresh problems? Maybe, there's another work-around.

              A 1 Reply Last reply
              0
              • A Anthony Baraff

                What are you actually trying to do that is causing refresh problems? Maybe, there's another work-around.

                A Offline
                A Offline
                Anonymous
                wrote on last edited by
                #7

                Basically i'm creating a program that analyzes waveforms. Each waveform can consist of around 200 data pts. There can be up to 8 waveforms displayed at once. The app allows the user to "scroll" through the signal to view a zoomed in portion of the waveform. So basically each signal has 3 views that get updated all at once, which causes a lot of processor usage since almost the entire screen gets redrawn. Right now i'm using 3 timers to update each of the views. Even with the delay in drawing, i'm almost maxing out on the processor. I've tried several different drawing techniques that include double buff and specific invalidating but no real luck. I would do the project in c++ but the time-frame i have is rather short so i decided to go with c#. If you have any suggestions on techniques please let me know. thanks, Brian

                A A 2 Replies Last reply
                0
                • A Anonymous

                  Basically i'm creating a program that analyzes waveforms. Each waveform can consist of around 200 data pts. There can be up to 8 waveforms displayed at once. The app allows the user to "scroll" through the signal to view a zoomed in portion of the waveform. So basically each signal has 3 views that get updated all at once, which causes a lot of processor usage since almost the entire screen gets redrawn. Right now i'm using 3 timers to update each of the views. Even with the delay in drawing, i'm almost maxing out on the processor. I've tried several different drawing techniques that include double buff and specific invalidating but no real luck. I would do the project in c++ but the time-frame i have is rather short so i decided to go with c#. If you have any suggestions on techniques please let me know. thanks, Brian

                  A Offline
                  A Offline
                  ACorbs
                  wrote on last edited by
                  #8

                  Just some FYI: If you are graphing a series of point as a continuous line make sure to use the DrawLines function and not DrawLine in a loop. I found a huge performance difference between the two when I was writing a graphing control. I don’t know if you are already doing this, but I thought I might mention it in case you’re not.

                  1 Reply Last reply
                  0
                  • A Anonymous

                    Basically i'm creating a program that analyzes waveforms. Each waveform can consist of around 200 data pts. There can be up to 8 waveforms displayed at once. The app allows the user to "scroll" through the signal to view a zoomed in portion of the waveform. So basically each signal has 3 views that get updated all at once, which causes a lot of processor usage since almost the entire screen gets redrawn. Right now i'm using 3 timers to update each of the views. Even with the delay in drawing, i'm almost maxing out on the processor. I've tried several different drawing techniques that include double buff and specific invalidating but no real luck. I would do the project in c++ but the time-frame i have is rather short so i decided to go with c#. If you have any suggestions on techniques please let me know. thanks, Brian

                    A Offline
                    A Offline
                    Anthony Baraff
                    wrote on last edited by
                    #9

                    If you do want to use DirectX take a look at overlays. That will allow you to create an area within your window to draw your charts without giving up all of the other UI niceties of C# and GDI+. My guess is that there isn’t anything here that you can’t do using GDI+. Here are a few things to check: Are you redrawing the background of your graph each time? It’s likely that a large number of drawing commands are spent redrawing an unchanging background every time the graph is drawn. Try caching the background and Blit it to your graph area. Are you using DrawLine or DrawLines? DrawLines is much faster. Is it really the drawing that is slow? Have you looked at the code with a profiler to see which methods are taking the longest? Regarding the double buffering, are you doing the buffering yourself in an off-screen object, or are you using the double buffer control style? Also, what are the timers for?

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups