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. C# GDI+

C# GDI+

Scheduled Pinned Locked Moved C#
graphicscsharpwinformsperformancetutorial
6 Posts 3 Posters 2 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.
  • C Offline
    C Offline
    codebala
    wrote on last edited by
    #1

    All, I would like to know how to increase the speed of the GDI object for drawing purpose. I need to draw lines connecting 100000 points. I am using graphics.drawline. But it takes approx 5 seconds to finish the task. How can I reduce the drawing time. CodeBala

    J K 2 Replies Last reply
    0
    • C codebala

      All, I would like to know how to increase the speed of the GDI object for drawing purpose. I need to draw lines connecting 100000 points. I am using graphics.drawline. But it takes approx 5 seconds to finish the task. How can I reduce the drawing time. CodeBala

      J Offline
      J Offline
      Josh Smith
      wrote on last edited by
      #2

      You should see some improvement if you call DrawLines instead of DrawLine. Josh

      C 2 Replies Last reply
      0
      • C codebala

        All, I would like to know how to increase the speed of the GDI object for drawing purpose. I need to draw lines connecting 100000 points. I am using graphics.drawline. But it takes approx 5 seconds to finish the task. How can I reduce the drawing time. CodeBala

        K Offline
        K Offline
        kasik
        wrote on last edited by
        #3

        You could try setting the Graphics.SmoothingMode property to HighSpeed before you draw the lines, like this...

        e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;

        Hope that helps :)


        “Accept that some days you are the pigeon, and some days you are the statue” -- David Brent Cheers, Will H

        C 1 Reply Last reply
        0
        • K kasik

          You could try setting the Graphics.SmoothingMode property to HighSpeed before you draw the lines, like this...

          e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;

          Hope that helps :)


          “Accept that some days you are the pigeon, and some days you are the statue” -- David Brent Cheers, Will H

          C Offline
          C Offline
          codebala
          wrote on last edited by
          #4

          Will, thanks for your reply. But for some reason the HighSpeed was increasing the time to draw. CodeBala

          1 Reply Last reply
          0
          • J Josh Smith

            You should see some improvement if you call DrawLines instead of DrawLine. Josh

            C Offline
            C Offline
            codebala
            wrote on last edited by
            #5

            Josh, thanks for your reply. But as per my logic I need to test for the validity of the point before drawing. So I have to use drawline only. Is their any other way??

            1 Reply Last reply
            0
            • J Josh Smith

              You should see some improvement if you call DrawLines instead of DrawLine. Josh

              C Offline
              C Offline
              codebala
              wrote on last edited by
              #6

              Hi Josh, thanks. I used Drawlines. Its amazing. Thanks again CodeBala

              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