Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

anti-aliased text & shapes

65 views
Skip to first unread message

Bryan

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
I'm currently using Win32 API to draw onto an HDC.
However, it looks ugly, not being anti-aliased.

How can I draw text (currently using TextOut),
anti-aliased in a TrueType font onto an HDC?

Similarly, how can I get functionality like
FillRect & RoundRect, but with anti-aliased edges?

Bryan


Sergey Hrushev

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
Hello, Bryan.

You must create a WindowDC-compatible DC in memory, than draw all into this
DC.
After drawing you must use your own function for anti-alias.
After anti-aliasing use BitBlt(...) to move data from MemoryDC to WindowDC.
I think, this approach is not simple but it will work and helps you.
Be careful if your application is time-critical.

With best regards,
Sergey Hrushev.


Bryan

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
Ho ho ho

I'm trying to get 60 fps, at 1600x1200 .....

Any idea where to pick up an antialias routine, an algorithm I can code?
I've no idea how it works (I know what it does, but not how).

Bryan

Sergey Hrushev wrote in message ...

John

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
Let me know if you find one. I've been trying to find a good algo for quite
some time. As far as 60fps goes, good luck. If you are using pixel-sampling
it is way too time consuming to do it in software. You'll never get 60fps,
and if you do, please share your algorithm. Basically, you have to read in
an array of pixels, usually 3x3, find the edge of the area to be filtered,
and then do an average of the three colors. You can modify the sample range,
but it only gets more expensive in cpu time. That's why you didn't see 3D
games with antialiasing for a long time. Now, the newer and better 3D cards
support full-screen antialiasing in hardware.

I can refer you to the bible of graphics algorithms. It is Computer
Graphics: Principles and Practice ISBN:0201848406. It is pretty intense on
the math end, but it should help. You should try browsing Amazon.com(no, I
don't work for them) in the programming section under Graphics & Multimedia.

Cheers.

"Bryan" <c@d.D> wrote in message
news:OOWXGi7c$GA....@cppssbbsa02.microsoft.com...

Phil McRevis

unread,
Feb 11, 2000, 3:00:00 AM2/11/00
to
[Please do not mail me a copy of your followup]

"John" <jmha...@microage.com> spake the secret code
<87vkfq$452$1...@nnrp02.primenet.com> thusly:

>Let me know if you find one. I've been trying to find a good algo for quite
>some time. As far as 60fps goes, good luck.

For text you can always ammortize the anti-aliasing by computing it
once for a specific font and cache the results. Then when you render
AA text using the same font you just blt the AA characters into the
final image. If you're using Direct3D as well, you can put the AA
font into a single texture map and draw it with textured quads.
--
http://www.xmission.com/~legalize Legalize Adulthood!
lega...@xmission.com
``Ain't it funny that they all fire the pistol, <URL: http://
at the wrong end of the race?''--PDBT www.eden.com/~thewho>

Sergey Hrushev

unread,
Feb 12, 2000, 3:00:00 AM2/12/00
to
Hello, all.

Let me note, that cached image of anti-aliased "A" can be used only if it
will be putted on "unicolor" background.
In case of "bitmapped" background antialiasing must be done for each
occurence of "A" independently.

About 60fps on 1600x1200:

1600*1200*60 = 115 200 000 bytes (with 8bit color depth, I think really
color depth is 16bit, 24bit or 32bit).
So to provide 60fps it is necessary to have in-memory transfer 115 200 000
bytes/s.
If such program will work on computer with 100MHz system bus it is
impossible to provide 115 200 000 transfer.
If anybody knows, can this be done on SGI or SUN ?

With best regards,
Sergey Hrushev.

> "John" <jmha...@microage.com> spake the secret code

0 new messages