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