Q: How do I use TextureBrush to paint my actual object (ex: rectangle) and NOT the background. (x-post /r/computerscience)

I am going to leave my full code below in a comment. Thank you.

So here is what my program looks like when I run it. It appears that my background is painted and my rectangles are "see-through." I am confused because my code has

1) BackColor = Color.Black; (so I am expecting a black background with TextureBrushed objects, NOT a TextureBrushed background with transparent objects.)

2) Rectangle Obj1 = new Rectangle(Obj1x, Obj1y, Obj1Width, Obj1Height); e.Graphics.FillRectangle(texture, Obj1); (and the same thing for Obj2, so my understanding is that I have applied the TextureBrush to the objects themselves.)

by buymeliptars via /r/csharp

Leave a Reply