Using GDI+ to create non-square custom controls

  • Thread starter Thread starter Jason
  • Start date Start date
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
 
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
 
Back
Top