Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8546

Drawing with Eto

$
0
0

@Tim_Williams wrote:

Can someone demonstrate how the Graphics classes work in Eto with python? I can never get the DrawLine() parameters correct, no matter what I input. Can the self.myLine then just be added to a DynamicLayout() or is there another object to handle it?

import Rhino.UI
import Eto.Drawing as drawing
import Eto.Forms as forms
import rhinoscriptsyntax as rs

class drawShapes(forms.Dialog[bool]):
    def __init__(self):
        self.MinimumSize = drawing.Size(200, 200)
        self.addLine()

    def addLine(self):
        self.pt0 = drawing.PointF(0,0)
        self.pt1 = drawing.PointF(50,50)
        self.color1 = drawing.Colors.Blue
        self.myLine = drawing.Graphics.DrawLine(self.color1, self.pt0, self.pt1)

dialog = drawShapes()
rc = dialog.ShowModal(Rhino.UI.RhinoEtoApp.MainWindow)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8546

Trending Articles