GDI Graphics are Imprecise

  • Thread starter existential.philosophy
  • Start date
E

existential.philosophy

When I use standard GDI graphics methods, like DrawRectangle or
FillEllipse, I've noticed that the results are slightly off.

I seldom work with graphics, but I'm doing a project now which
requires me to draw precise shapes. I've discovered that, in order to
get crisp results, I have to "nudge" the coordinates. For instance,
instead of drawing a rectangle with

DrawRectangle(Pen1, X, Y, Width, Height)

I must use

DrawRectangle(Pen1, X + 0.001953, Y + 0.001953, Width, Height)

Is anyone familiar with this issue? I'm guessing it is a problem with
Windows (I'm using Windows XP Pro), but I'd like to learn more.


-TC
 
H

Herfried K. Wagner [MVP]

When I use standard GDI graphics methods, like DrawRectangle or
FillEllipse, I've noticed that the results are slightly off.

No need to repost -- the same question posted by you yesterday got two
replies in the meantime.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top