|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Draw Half and Ellipse"David" <dw85745***@earthlink.net> wrote in message The Arc() function?news:eBGuSRjrJHA.528@TK2MSFTNGP06.phx.gbl... > Anyway to draw half and Ellipse using the API? If not what's best way? "David" <dw85745***@earthlink.net> wrote in message You can use either the Arc API function or the native VB6 Circle method:news:eBGuSRjrJHA.528@TK2MSFTNGP06.phx.gbl... > Anyway to draw half and Ellipse using the API? > If not what's best way? 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 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 > > > > 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. |
|||||||||||||||||||||||