www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to draw a simple square with gtk-d ?

reply Alain De Vos <devosalain ymail.com> writes:
I look for a demo program how to draw a simple square with gtk-d ?
Dec 07 2024
next sibling parent Mike Shah <mshah.475 gmail.com> writes:
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
prev sibling parent Aravinda VK <mail aravindavk.in> writes:
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