Forum > Graphics

STARS and Regular POLYGONS: Zorder type bug!

(1/1)

Boleeman:
Make some STARS and Polygons on a TPaintbox with some Mouse Clicks.

Go to last thread please.

Boleeman:
Now with line styles and save to png.

Boleeman:
Now you can select to draw Stars or Regular Polygons.

Can draw a Star on top of a Star and a Polygon on top of a Polygon and a Polygon on top of a Star.

But ... Just one bug: Can't draw a Star on top of a polygon.

KodeZwerg:
I have not downloaded your source, just watched images, this would be my way to control the drawing including z-order:
As always I would draw internal on a TBitmap :-D
Offer to set background color somewhere.
Offer to choose (inner/outer) color somewhere.
Offer to choose element style (star/polygon/whatever) somewhere.
Realize drawing by using an array of TShapes, the index will be than the z-order.
That way you could add drag/drop support for elements or tweak the z-order by moving the indexes.
Finally draw the array to TBitmap and assign it to whatever control you are painting onto.

Boleeman:
Thanks KodeZwerg

Was drawing to TPaintbox, but I will need to try to draw internal on a TBitmap


Temp work around:
If the Polygon is smaller than the star then I found I could draw the star oversized, with the center polygon going on top automatically.

Also wanted to know how to save to svg, instead of png, Will probably need bgraBmp for that.

Navigation

[0] Message Index

Go to full version