How to: rotate an ellipse

Example requests & Code samples for GdPicture Toolkits.
Post Reply
goldrian
Posts: 22
Joined: Fri Jun 03, 2011 7:57 pm

How to: rotate an ellipse

Post by goldrian » Wed Aug 03, 2011 11:42 am

I need to draw rotated ellipses on a jpg image using GdPicture7.
I see that there is a GdPictureImaging.DrawRotatedRectangle method, but not an equivalent one for ellipses.
Any idea to achieve it? :?
Thanks!

goldrian
Posts: 22
Joined: Fri Jun 03, 2011 7:57 pm

Re: How to: rotate an ellipse

Post by goldrian » Wed Aug 03, 2011 10:57 pm

Meanwhile I've tried using arcs, beziers... no way.
I can create a new image, draw an ellipse on it, rotate the image and publish the image on the other, but performance is too low.
I'm starting to think that it's not possible: panic! :cry:

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: How to: rotate an ellipse

Post by Loïc » Fri Aug 05, 2011 2:32 am

Hi,

You have 2 options:

- 1 drawing the ellipse on an empty bitmap, rotate the image by specific angle then merge your 2 images (as you said, this is slow)
- 2 using GDI+. You can get a graphics object from a gdpicture image using the GetGraphicsFromGdPictureImage. Use GDI+ to draw your stuff on the graphics object, the dispose it.
- And 3 (not yet implemented). We will add a drawrotatedellipse function on the next release for convenience.

Kind regards,

Loïc

goldrian
Posts: 22
Joined: Fri Jun 03, 2011 7:57 pm

Re: How to: rotate an ellipse

Post by goldrian » Fri Aug 26, 2011 9:14 am

Thank you Loic, I used the second method you suggested.
Thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest