digitalmars.D.learn - How to draw a simple square with gtk-d ?
- Alain De Vos (1/1) Dec 07 2024 I look for a demo program how to draw a simple square with gtk-d ?
- Mike Shah (6/8) Dec 09 2024 Probably worth pointing you toward
- Aravinda VK (18/20) Dec 10 2024 Are you looking for drawing green square using D or gtk? (I
I look for a demo program how to draw a simple square with gtk-d ?
Dec 07 2024
On Sunday, 8 December 2024 at 04:06:40 UTC, Alain De Vos wrote:I look for a demo program how to draw a simple square with gtk-d ?Probably worth pointing you toward https://github.com/rontarrant/gtkDcoding/tree/master/_posts for now as that is probably the most complete set of examples. There should be some examples of drawing images, or otherwise setting up a drawing area which may be what you wanted.
Dec 09 2024
On Sunday, 8 December 2024 at 04:06:40 UTC, Alain De Vos wrote:I look for a demo program how to draw a simple square with gtk-d ?Are you looking for drawing green square using D or gtk? (I observed your comment in reddit/r/crystal_programming as well). You can use Chitra library to draw a square and save it as png. Try it out. ```d import chitra; void main() { // Canvas of size 400x400 auto ctx = new Chitra(400); ctx.fill(0, 255, 0); ctx.square(0, 0, 400); ctx.saveAs("green_rect.png"); } ``` Refer https://github.com/aravindavk/chitra-d for installation and usage details.
Dec 10 2024