Inverted Round Corners vs CreateRoundRectRgn-VBForums
Results 1 to 5 of 5

Thread: Inverted Round Corners vs CreateRoundRectRgn

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    389

    Inverted Round Corners vs CreateRoundRectRgn

    I am looking for a way of making a Region like this...



    Instead of the normal rounded corners, it is reversed, kinda...

    Is there a function or an api that I can call to return a rgn like that?
    Visual Basic Rules!!!!!

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    389

    Re: Inverted Round Corners vs CreateRoundRectRgn

    I refuse from using Shape controls... Owner Drawn 100%
    Visual Basic Rules!!!!!

  4. #4

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    389

    Re: Inverted Round Corners vs CreateRoundRectRgn

    Anybody mind helping me perfect this function?

    I wrote this btw...


    API:
    Code:
    Private Declare Function CreateRectRgn Lib "gdi32.dll" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
    Private Declare Function CreateEllipticRgn Lib "gdi32.dll" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
    Private Declare Function CombineRgn Lib "gdi32.dll" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
    Private Const RGN_DIFF As Long = 4


    Code:
    Private Function CreateRoundRectRgnI(ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
        
        Dim rgnTopLeft As Long, rgnTopRight As Long, rgnBtmLeft As Long, rgnBtmRight As Long
        Dim rgnMain As Long
        Dim rgnHolder As Long
           
        rgnTopLeft = CreateEllipticRgn(-(X3), -(Y3), X3, Y3)
        rgnTopRight = CreateEllipticRgn((X2 + X3), -(Y3), X2 - X3, Y3)
        rgnBtmLeft = CreateEllipticRgn(-(X3), (Y2 + Y3), X3, Y2 - Y3)
        rgnBtmRight = CreateEllipticRgn((X2 + X3), (Y2 + Y3), X2 - X3, Y2 - Y3)
        
        rgnMain = CreateRectRgn(0, 0, X2, Y2)
        rgnHolder = CreateRectRgn(0, 0, 0, 0)
        
        CombineRgn rgnHolder, rgnMain, rgnTopLeft, RGN_DIFF
        CombineRgn rgnMain, rgnHolder, rgnTopRight, RGN_DIFF
        CombineRgn rgnHolder, rgnMain, rgnBtmLeft, RGN_DIFF
        CombineRgn rgnMain, rgnHolder, rgnBtmRight, RGN_DIFF
        
        CreateRoundRectRgnI = rgnMain
        
    End Function
    Visual Basic Rules!!!!!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.