So, what is most easy way to draw anti-aliased lines and curves? I don's want to draw to bitmap and then to draw to screen. Maybe some dll?
Posted on 2003-04-18 14:58:48 by JohnFound
I do not think there is such a function insides Win32API...

I am afraid you will have to build your own :(

search wu-pixels on gooogle

http://freespace.virgin.net/hugo.elias/graphics/x_wupixl.htm

This might help also (was in the FAQ here)

http://courses.ece.uiuc.edu/ece291/archive/archive-f2000/mp/mp4/anti.html

but since you did not wanted the algorithm :(
Posted on 2003-04-19 03:26:56 by BogdanOntanu
Most of the real-world code I've looked at don't actually "draw antialiased lines" per se, they draw everything without antialiasing, and then apply antialiasing to the entire image, saving many cycles when drawing a lot of items.
The other reason for this is because they are lazy and they know that theres api functions for applying certain hardcoded filters to images, and antialiasing is one of the standard filters.
Posted on 2003-04-23 07:59:33 by Homer
Hm, actually I can use my functions and draw to the bitmap and then BitBlt this bitmap to the DC of the window. But this is so tedious (and I don't need it at all). :(
So, I don't think that antialias of the whole bitmap will be faster than antialiasing of the separate lines, and also I don't think the result will be the same.
--
So, then the next question: How to make fast pixel drawing (implement my algorithms) to the DC without double buffering?
Posted on 2003-04-23 08:37:04 by JohnFound
hi JohnFound

here is my solution : (it uses double buff)
- Create a off screen device context 2x bigger than your visible drawing area
- call for SetStretchBltMode,hDC,4
- Draw your stuff using common api
- call StretchBlt
- that's it :grin:

don't expect hight speed !!!!! :grin: :grin: :grin: :grin:
Posted on 2003-04-23 09:08:50 by PhoBos
My digibrain program (see website) just draws everything twice as big and then rescales it to half its size, have a look at it.

Thomas
Posted on 2003-04-23 09:57:55 by Thomas
I'm trying to do some simple antialiasing too -- by simple I mean: just use an API instead of coding it <grin>

I searched in MSDN.
Didn't find much. :-(

A lot of references to OpenGL & DirectX, but no simple GDI function.
I found a reference to AlphaBlend (msimg32.dll), too, but if I understand it right, this function would be useful for coding the antialias effect, not for applying it directly...

If you find a solution, could you post something here or mail me?
thank you very much!
Posted on 2003-04-23 16:33:55 by MayBe
GDI+ supports anti-aliasing but it's XP only (or NT4+/98+ with gdiplus.dll), and it's a C++ API so probably not of much use to you. AFAIK that's the only API windows has for anti-aliased lines.

Thomas
Posted on 2003-04-23 17:10:53 by Thomas
Thank you guys.
Visibly I will make double buffering with my functions for drawing. When I implement them I will post the sources to the board.

Regards.
Posted on 2003-04-24 01:08:11 by JohnFound

GDI+ supports anti-aliasing but it's XP only (or NT4+/98+ with gdiplus.dll), and it's a C++ API so probably not of much use to you. AFAIK that's the only API windows has for anti-aliased lines.
By the way: is gdiplus.dll free? Where can one download it?
Posted on 2003-04-24 03:16:46 by Maverick
Gdiplus.dll can be found at Microsoft Download Center (about 5 meg I believe)

GDI+ has all the API's built in for Anti-alias, AlphaBlend, Transparancies, and more...
works for 98 and better w/ DLL

Also:
Double Buffering is definately better for speeding up graphic's .... especially when you might be moving Dialogs arround... because bitblt is is very close to hardware... closer than DirectX .. (I believe)

StretchBlt, is almost just as fast, it works by adding and/or removing x/y slices of the bitmap, so if your image has curves then StretchBlt makes a mess of the quality... so better to compute the slices yourself...

the global filtering techniques work to sharpen, soften or blend the entire image... so if you are interested in working with vector graphics, then they don't work that well...

for vector graphics, personally, I believe it's best just to take the time to write your own
line and curve functions , such that you can control the blending and speed...

the PowerBASIC.com forum has quite a bit of info on using graphics w/ windows ....
the site search engine sucks, but one of the members; Borje, has provided an off-line
search utility; "POFFS" which is free at his site...

quite honestly, there is much more information, about using the windows "garbage" at the
PB Forum than here... you guy's really should follow both of these excellent Forums... PB and here...IMO :)

Brad
Posted on 2003-04-24 07:27:07 by Brad