Draw curves on DC without curve compatability?

Paul Thomas
01-28-2005, 06:23 AM
How can I draw curves on a DC that doesn't support curves by default?

01-28-2005, 08:35 AM
What 'type' of curves you want to draw?

I've uploaded some curve fitting methods in the forum. Check it out..


01-28-2005, 10:40 PM
How can I draw curves on a DC that doesn't support curves by default?
I really don't know what you mean "support curves by default" :huh:

Drawing curves on a DC is really (ultimately) not much different than drawing lines in a picturebox or form (since, of course, both a picturebox control and a form HAVE their own DCs).

A curve can be drawn by creating a series of very short, mathematically placed lines. In drawing to a memory DC, the VB Line method can be replaced by the use of the LineTo and MoveToEx APIs

The type of curve is determined by the algorithm used. The shape of the curve is determined by the placment of it's control points.
But you weren't specific as to what type of curves you want. :whoops:

This thread has links to several bezier curve demos on the forum, as well as an attachment at the end which does B-Spline curves:

Paul Thomas
01-29-2005, 03:51 AM
Thanks some DC don't support curves (biezer, arc,ect), or lines or many other things. To find out whether a DC supports curves you use:
GetDeviceCaps hDC, CURVECAPS
If the return value is 0 it doesn't support curves. What I want to know is how can I change this or get round it. I will look at curve fitting.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum