Using GDI+ to create non-square custom controls

J

Jason

I'm working on creating a little playing field map for a game I'm
programming in C# and I have some questions about GDI+ for custom controls.
Right now I have a class called Tile that I use to create a square tile with
some graphics on it. Then on my map I basically load a 2 dimensional array
of these tiles.

However, What I really want is for the tiles to be in the shape of a
parallelogram so that I can have an isometric view. I know I can use the
fill Polygon to turn my Tile class into a parallelogram. My problem is that
when I go to place them On my game panel I want the parallelograms to butt
right up to each other. How can I do this because the lower left corner of
the parallelogram is inside the bounding box of the parallelogram control
next to it so it basically covers up part of the control. I tried things
like send to back or bring to front but that didn't do anything.

I would really appreciate any ideas.

Thanks
Jason
 
T

The Last Gunslinger

Jason said:
I'm working on creating a little playing field map for a game I'm
programming in C# and I have some questions about GDI+ for custom controls.
Right now I have a class called Tile that I use to create a square tile with
some graphics on it. Then on my map I basically load a 2 dimensional array
of these tiles.

However, What I really want is for the tiles to be in the shape of a
parallelogram so that I can have an isometric view. I know I can use the
fill Polygon to turn my Tile class into a parallelogram. My problem is that
when I go to place them On my game panel I want the parallelograms to butt
right up to each other. How can I do this because the lower left corner of
the parallelogram is inside the bounding box of the parallelogram control
next to it so it basically covers up part of the control. I tried things
like send to back or bring to front but that didn't do anything.

I would really appreciate any ideas.

Thanks
Jason


Have you set the region of the class to the parallelogram?

JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top