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. Drawing a 2D matrice of double values

Drawing a 2D matrice of double values

Scheduled Pinned Locked Moved C#
questiongraphics
4 Posts 3 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.
  • I Offline
    I Offline
    israeli
    wrote on last edited by
    #1

    Hi ! I have a very large 2D matrice of double values (10000 x 10000 cells). How can I convert this matrice into an image so that I'll be able to plot the values ? looping over the cells and drawing with GDI is out of the question. Thanks

    D 1 Reply Last reply
    0
    • I israeli

      Hi ! I have a very large 2D matrice of double values (10000 x 10000 cells). How can I convert this matrice into an image so that I'll be able to plot the values ? looping over the cells and drawing with GDI is out of the question. Thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I don't see how you're going to be able to plot anything without looping over the cells somehow. Also, plot the image on what? It's going to be 10,000 pixel by 10,000 pixels. The screen is out of the question to plot an image that big. It all depends on what and how you want this image to be displayed. If it's acceptable to show the entire image inside the screen dimensions, alot of detail will be lost, but you can shorten the time it takes by mapping pixel coord onto the matric and only return the values at those pixel coords. For instance, 1024, 768 on the screen would map to 10000, 10000 in the matrix. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      I 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I don't see how you're going to be able to plot anything without looping over the cells somehow. Also, plot the image on what? It's going to be 10,000 pixel by 10,000 pixels. The screen is out of the question to plot an image that big. It all depends on what and how you want this image to be displayed. If it's acceptable to show the entire image inside the screen dimensions, alot of detail will be lost, but you can shorten the time it takes by mapping pixel coord onto the matric and only return the values at those pixel coords. For instance, 1024, 768 on the screen would map to 10000, 10000 in the matrix. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        I Offline
        I Offline
        israeli
        wrote on last edited by
        #3

        Hi Dave, Of course I'll have to loop over the cells and to loose information when displaying the smaller picture. The question is how am I displaying the picture ?. I can define a Bitmap object (smaller than the array) but how can I display the bitmap without saving it on H.D. ? Thanks

        L 1 Reply Last reply
        0
        • I israeli

          Hi Dave, Of course I'll have to loop over the cells and to loose information when displaying the smaller picture. The question is how am I displaying the picture ?. I can define a Bitmap object (smaller than the array) but how can I display the bitmap without saving it on H.D. ? Thanks

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Create a custom control, its the easiest.

          override OnPaint(PainteventArgs pea)
          {
          Bitmap b = new Bitmap(10000,10000);
          //fill pixels (in grayscale)
          pea.Graphics.Transform = new Matrix(Width/10000f,0,0,Height/10000f,0,0);
          pea.Graphics.DrawImage(b);
          b.Dispose();
          }

          xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

          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