0

So, I'm developing a small program in C# that involves rendering a structure. I started by using Graphics() but because of certain limitations and for the sake of learning, I created my own 3D engine class (or sort of).

That class stores and manipulates the pixels in a matrix of:

public class pixel { public Color cor = new Color(); public int z = Int32.MinValue; } 

where z is used for visibility check.

Now that I've checked the results (by creating a bitmap file from the matrix), I want to draw and manipulate that matrix directly into a element in my WPF. So i want to know if there's a simple way to do this.

I'm very fresh on all this, so if there is something that i might be missing please tell me, sometimes i don't know what i should really search for.

2
  • These answers may help you : stackoverflow.com/questions/15274699/… and stackoverflow.com/questions/1118496/… Commented Dec 19, 2016 at 15:06
  • It's unclear what manipulation exactly means here. For drawing, create a BitmapSource and assign it to the Source property of an Image control. Set BitmapScalingMode.NearestNeighbor. Commented Dec 19, 2016 at 15:07

1 Answer 1

0

After trying some different approaches, i ended up storing the data in the matrix in a different way.

My current solution is to draw directly on a Bitmap (that can be easily passed to a PictureBox control) and at the same time store additional info in a matrix the same size as the Bitmap.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.