Home All Groups Group Topic Archive Search About
Author
26 Mar 2009 5:00 PM
David
Anyway to draw half and Ellipse using the API?  If not what's best way?

Author
26 Mar 2009 5:42 PM
Jeff Johnson
"David" <dw85745***@earthlink.net> wrote in message
news:eBGuSRjrJHA.528@TK2MSFTNGP06.phx.gbl...

> Anyway to draw half and Ellipse using the API?  If not what's best way?

The Arc() function?
Author
26 Mar 2009 5:50 PM
Michael Williams
"David" <dw85745***@earthlink.net> wrote in message
news:eBGuSRjrJHA.528@TK2MSFTNGP06.phx.gbl...

> Anyway to draw half and Ellipse using the API?
>  If not what's best way?

You can use either the Arc API function or the native VB6 Circle method:

Option Explicit
Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, _
  ByVal X1 As Long, ByVal Y1 As Long, _
  ByVal X2 As Long, ByVal Y2 As Long, _
  ByVal X3 As Long, ByVal Y3 As Long, _
  ByVal X4 As Long, ByVal Y4 As Long) As Long

Private Sub Command1_Click()
Dim pi As Single
pi = Atn(1) * 4
Me.ScaleMode = vbPixels
Me.Circle (250, 100), 50, , pi, pi / 2
Arc Me.hdc, 50, 50, 150, 150, 50, 100, 100, 50
End Sub
Author
26 Mar 2009 6:00 PM
David
Thanks guys -- forgot about ARC

Consider this thread closed.


Show quoteHide quote
"Michael Williams" <M***@WhiskeyAndCoke.com> wrote in message
news:%23cPL0tjrJHA.5356@TK2MSFTNGP03.phx.gbl...
> "David" <dw85745***@earthlink.net> wrote in message
> news:eBGuSRjrJHA.528@TK2MSFTNGP06.phx.gbl...
>
>> Anyway to draw half and Ellipse using the API?
>>  If not what's best way?
>
> You can use either the Arc API function or the native VB6 Circle method:
>
> Option Explicit
> Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, _
>  ByVal X1 As Long, ByVal Y1 As Long, _
>  ByVal X2 As Long, ByVal Y2 As Long, _
>  ByVal X3 As Long, ByVal Y3 As Long, _
>  ByVal X4 As Long, ByVal Y4 As Long) As Long
>
> Private Sub Command1_Click()
> Dim pi As Single
> pi = Atn(1) * 4
> Me.ScaleMode = vbPixels
> Me.Circle (250, 100), 50, , pi, pi / 2
> Arc Me.hdc, 50, 50, 150, 150, 50, 100, 100, 50
> End Sub
>
>
>
>
Author
26 Mar 2009 8:00 PM
Karl E. Peterson
David wrote:
> Anyway to draw half and Ellipse using the API?  If not what's best way?

VB's Circle method can do this, too, if you don't want to go API on it.
--
..NET: It's About Trust!
http://vfred.mvps.org