473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Drawing a circle

Hi,
I'd like to draw a circle on the screen using GDI+
I'm using the DrawEllipse method with width = height and I set the
SmootingMode to SmoothingModeAntiAlias but the circle is "squared".
Is there a way to draw a "smoothed" circle ?

Thanks in advance
Stefano
Jan 3 '06 #1
7 2108
set the smoothing mode to 'HighQuality' ?

kind regards,
Bruno.

"Stefan0" <my****@myprovider.com> wrote in message
news:qe********************************@4ax.com...
Hi,
I'd like to draw a circle on the screen using GDI+
I'm using the DrawEllipse method with width = height and I set the
SmootingMode to SmoothingModeAntiAlias but the circle is "squared".
Is there a way to draw a "smoothed" circle ?

Thanks in advance
Stefano

Jan 3 '06 #2
On Tue, 3 Jan 2006 16:47:46 +0100, "Bruno van Dooren"
<br**********************@hotmail.com> wrote:
set the smoothing mode to 'HighQuality' ?


Thanks for you answer.
I've already tryed ... I can't see much difference between those 2
smoothing modes.

Jan 3 '06 #3
i did the following on a test form in a C# application:

private void button1_Click(object sender, System.EventArgs e)
{
System.Drawing.Graphics graphics = this.CreateGraphics();
System.Drawing.Rectangle rectangle = new Rectangle(100, 100, 200,
200);

graphics.DrawEllipse(System.Drawing.Pens.Black, rectangle);
}

this showed a rather nice circle with some squarization (or what did you
call it).
however, i think this is unavoidable.
you are drawing a circle on a screen with a fixed number of pixels, but you
cannot draw half pixels.
as such, regardless of anti aliasing, you will always have pixels that are
not exactly on the circle circumference.

the only solution i think would be to go to a higher resolution for the
monitor, and then draw 'larger' circles.

kind regards,
Bruno.

"Stefan0" <my****@myprovider.com> wrote in message
news:s0********************************@4ax.com...
On Tue, 3 Jan 2006 16:47:46 +0100, "Bruno van Dooren"
<br**********************@hotmail.com> wrote:
set the smoothing mode to 'HighQuality' ?


Thanks for you answer.
I've already tryed ... I can't see much difference between those 2
smoothing modes.

Jan 3 '06 #4
the only solution i think would be to go to a higher resolution for the
monitor, and then draw 'larger' circles.


Thank again.
Well I was wondering which algorithm use some painting program to draw
nice circles ... anyway if this is the maximum quality that I can
obtain ... I'll use this way :)
Jan 3 '06 #5
the algorithm is such that for each pixel, the difference with the 'ideal'
circle is calculated.
the pixels are placed just so that the total difference from the perfect
circle is as small as possible.

the problem is that you want to draw something curved on a drawing board on
which you can only use small square blocks. going high res doesn't change
anything except that the 'blocks' with which you can draw are smaller.

kind regards,
Bruno.
"Stefan0" <my****@myprovider.com> wrote in message
news:bm********************************@4ax.com...
the only solution i think would be to go to a higher resolution for the
monitor, and then draw 'larger' circles.


Thank again.
Well I was wondering which algorithm use some painting program to draw
nice circles ... anyway if this is the maximum quality that I can
obtain ... I'll use this way :)

Jan 3 '06 #6
Stefan0 wrote:
Thank again.
Well I was wondering which algorithm use some painting program to draw
nice circles ... anyway if this is the maximum quality that I can
obtain ... I'll use this way :)


Have you tried VG.NET? The rendering engine part of it is free:
http://vgdotnet.com/

For native applications, the best you can get is the D-type rasterizer,
which is a commercial library with a C-style DLL:
http://d-type.com/rasterizer/screenshots.htm

Tom
Jan 3 '06 #7
On Tue, 03 Jan 2006 12:16:03 -0800, Tamas Demjen <td*****@yahoo.com>
wrote:

Have you tried VG.NET? The rendering engine part of it is free:
http://vgdotnet.com/


Thank you, I'll give it a look

Jan 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Remon Huijts | last post by:
Hi there, For a very specific service, I have created a PHP script that uses the GD library functions to create a PNG image from a few lines of XML data describing a simple diagram/drawing. It's...
19
by: Atif | last post by:
Hello all, In my html page I want to add an image say of 800x600. Now I want that when ever I am given two coordinates on this image say (x1, y1)=(50, 100) and (x2, y2)=(200, 300), the java script...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
0
by: Ranjit | last post by:
Hi, I would like to know how to place circles in the connecting points of the lines, and very close to the circles I would like to place the values like a,b,c...etc automatically for each...
8
by: Hugh Janus | last post by:
I am trying to draw a compass on a form but my maths is not up to scratch! I have the disc with the bearing markers but have no idea how to calculate the needle line based on the desired degree. ...
0
by: CharChabil | last post by:
Hey Guys Kindly help me with the following function in vb.net 2005 I want to write a function that does the following 1. Go to pixels (x,y) 2. Draw a circle or a rectangle at the above pixels,...
1
by: sravan_reddy001 | last post by:
I am creating an analog clock. so i hav to draw the line from center to a point in the circle. How can i get the co-ordinates of the points on the circle i fmention the radius and the center of the...
4
debasisdas
by: debasisdas | last post by:
This article contains the basic syntax to draw graphics of various shapes and sizes in Visual Basic 6.0. Different types of geometrical shapes (rectangle, square, circle, arc, ellipse etc.) can be...
4
by: Terrence Brannon | last post by:
Hello, I have written a program to draw a vescica piscis <http:// en.wikipedia.org/wiki/Vesica_piscis> from turtle import * def main(): setup(width=400, height=400) r = 50 color("black")
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.