Jump to content

Bitmap/Bézier curves/Quadratic: Difference between revisions

no edit summary
m (Automated syntax highlighting fixup (second round - minor fixes))
No edit summary
Line 585:
Sleep
End</syntaxhighlight>
 
 
=={{header|FutureBasic}}==
FB has a convenience Bézier curve function that accepts a start point, end point, left control point, right control point, path stroke width and path color as demonstrated below. Here's a link to an illustration that's helpful in understanding the inputs:
[https://i.stack.imgur.com/WLZ5o.png Bézier curve function paramters.]
<syntaxhighlight lang="futurebasic">
_window = 1
 
void local fn BuildWindow
window _window, @"Quadratic Bezier Curve", ( 0, 0, 300, 300 ), NSWindowStyleMaskTitled + NSWindowStyleMaskClosable + NSWindowStyleMaskMiniaturizable
WindowCenter(1)
WindowSubclassContentView( _window )
ViewSetFlipped( _windowContentViewTag, YES )
ViewSetNeedsDisplay( _windowContentViewTag )
end fn
 
void local fn DrawInView( tag as long )
BezierPathStrokeCurve( fn CGPointMake( 20, 20 ), fn CGPointMake( 280, 20 ), fn CGPointMake( 60, 340 ), fn CGPointMake( 240, 340 ), 4.0, fn ColorRed )
end fn
 
void local fn DoDialog( ev as long, tag as long )
select ( ev )
case _viewDrawRect : fn DrawInView( tag )
case _windowWillClose : end
end select
end fn
 
on dialog fn DoDialog
 
fn BuildWindow
 
HandleEvents
</syntaxhighlight>
{{output}}
[[File:Quadratic Bezier Curve.png]]
 
 
=={{header|Go}}==
{{trans|C}}
Line 631 ⟶ 668:
}
}</syntaxhighlight>
 
=={{header|Haskell}}==
<syntaxhighlight lang="haskell">{-# LANGUAGE
723

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.