Jump to content

draw circle


Recommended Posts

Hello,

I have a question related to the circle drawing method of PDN3. ( brush )

I developed at my own a bitmap class, which can draw faster than getpixel, setpixel of .NET. But when I draw onto the bitmap in my level editor with the circle tool it's too slow. How does this thing works in PDN3. I played around with it, and it's much faster than mine.

FillEllipse(20,20); // .NET -- 270-280 ticks

DrawCircle(20,20); // My method -- 190-210 ticks

How is it done in PDN3? Has it better drawing times or is there a trick?

And would someone take the time to post the specific code snippet here? Much thanks.

game design rocks...

Link to comment
Share on other sites

Hello,

I have a question related to the circle drawing method of PDN3. ( brush )

I developed at my own a bitmap class, which can draw faster than getpixel, setpixel of .NET. But when I draw onto the bitmap in my level editor with the circle tool it's too slow. How does this thing works in PDN3. I played around with it, and it's much faster than mine.

FillEllipse(20,20); // .NET -- 270-280 ticks

DrawCircle(20,20); // My method -- 190-210 ticks

How is it done in PDN3? Has it better drawing times or is there a trick?

And would someone take the time to post the specific code snippet here? Much thanks.

game design rocks...

Link to comment
Share on other sites

the System.Drawing.Graphics class has functions called DrawEllipse() and FillEllipse(), which are, of course, far faster than setting one pixel at a time. Plus the Graphics class has extremely easy to use anti-aliasing.....

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

the System.Drawing.Graphics class has functions called DrawEllipse() and FillEllipse(), which are, of course, far faster than setting one pixel at a time. Plus the Graphics class has extremely easy to use anti-aliasing.....

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

I haven't looked in the code to answer your question, but in my expirence, the best way to draw standard shapes is to use GDI+.

You can see how to do it in my source code here:

http://paintdotnet.12.forumer.com/viewtopic.php?t=2580

(Ignore the source code listing in that post. Instead, download the VS2005 project zip file listed under the "Source Code" section.)

The nice thing about using GDI+ is the fact that you can draw anti-aliased shapes, fast.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

I haven't looked in the code to answer your question, but in my expirence, the best way to draw standard shapes is to use GDI+.

You can see how to do it in my source code here:

http://paintdotnet.12.forumer.com/viewtopic.php?t=2580

(Ignore the source code listing in that post. Instead, download the VS2005 project zip file listed under the "Source Code" section.)

The nice thing about using GDI+ is the fact that you can draw anti-aliased shapes, fast.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

I've developed my own bitmap class, because then I have much more possibilites related to the perfomance. My other reason is, that I need this later for XNA purposes and so it's much more easier to port this class. I just found some bottlenecks in my code, the invalidate, lock/unlock bits thing and the circle calculation. I'll post later the results, when I'm finished.

game design rocks...

Link to comment
Share on other sites

I've developed my own bitmap class, because then I have much more possibilites related to the perfomance. My other reason is, that I need this later for XNA purposes and so it's much more easier to port this class. I just found some bottlenecks in my code, the invalidate, lock/unlock bits thing and the circle calculation. I'll post later the results, when I'm finished.

game design rocks...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...