[fxruby-users] Drawing a rotated ellipse

Lyle Johnson lyle at lylejohnson.name
Mon Jul 14 18:09:49 EDT 2008

On Mon, Jul 14, 2008 at 4:43 PM, RkyMtnEng <jhadders at ball.com> wrote:

> I'm trying to draw an ellipse using a device context on an FXCanvas.  I need
> to be able to rotate the ellipse however (i.e. rotate the ellipse by 45
> degrees) and haven't found any rotation settings for the device context
> drawing objects.  Is there a way to do this?  If so, how would I accomplish
> that?  If not, are there any other ways to accomplish this besides using a
> device context?

There's nothing built in to FXCanvas (or the FXDC class) to
arbitrarily rotate objects like ellipses; you'd need to write your own
ellipse-drawing routine that's able to do those transformations.

You might be able to do this more easily with FXGLCanvas (i.e. using
the GLCanvas as a 2D canvas and ignoring the third dimension). You'd
still need to come up with ellipse-drawing code, but you should be
able to take advantage of OpenGL's support for transformation
matrices. (Of course that's not of much help if you don't know

More information about the fxruby-users mailing list