Results 1 to 5 of 5

Thread: arc API

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Wink

    When using the arc API call how do I change the drawing color so I get different colour arcs?

    Can someone also give me an example of the arc function being used.

    Thanks, it would help me out a great deal.


    Things I do when I am bored: DotNetable

  2. #2
    Guest
    You should be able to change the "ForeColor" Property of the surface you are drawing on.

    Z.

  3. #3
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    Here's an example:

    Code:
    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 Form_Load()
        'KPD-Team 1998
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        'Set graphical mode to persistent
        Me.AutoRedraw = True
        'Draw to arcs
        Arc Me.hdc, 0, 0, 100, 100, 100, 50, 50, 100
        Arc Me.hdc, 49, 49, 149, 149, 49, 99, 99, 49
    End Sub
    BTW: You can also change the drawing color by creating and selecting a new pen (via API).

  4. #4
    Guest
    Creating a Pen is the same thing as changing the "ForeColor" property, just wrapped up by VB.

    Z.

  5. #5
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    Yes I know, but if you draw anything on a memory DC, then you can only use APIs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width