Shordi
Estoy usando PicPanel n un proyecto, pero lo modifique un poco para usar
arc en vez de
curve ya que en los arcos (y en los chaflanes) se produce una aberración debido a los pixeles de la pantalla supongo.
Este es el código:
Código:
Public Sub PicPanel_Draw()
Dim iColor, iMargin As Integer
Dim iFlag As Integer = Style.StateOf(Me)
Dim n, i As Integer
Dim p As Integer
Dim ax As Variant[] = [[Rad(0), Rad(270)], [Rad(270), Rad(90)], [Rad(180), Rad(90)], [Rad(90), Rad(90)]]
Dim vx As Integer[][] = [[0, 0], [$hPicPanel.w, 0], [$hPicPanel.w, $hPicPanel.h], [0, $hPicPanel.h], [0, 0]]
'Enabled / Disable
If iFlag And Style.Disabled Then
iColor = Color.Merge(Me.Background, $iBorderColor, 0.75)
Else
iColor = $iBorderColor
Endif
Paint.Begin($hPicPanel)
Paint.MoveTo($Radius[0], $Radius[0])
Paint.Arc($Radius[0], $Radius[0], $Radius[0], Rad(180), Rad(90), False) ' r0
Paint.Arc($Radius[1], $hPicPanel.h - $Radius[1], $Radius[1], Rad(90), Rad(90), False) ' r1
Paint.Arc($hPicPanel.w - $Radius[2], $hPicPanel.h - $Radius[2], $Radius[2], 0, Rad(90), False) ' r2
Paint.Arc($hPicPanel.w - $Radius[3], $Radius[3], $Radius[3], Rad(270), Rad(90), False) ' r3
Paint.MoveTo($Radius[0], 0)
Paint.LineTo($hPicPanel.w - $Radius[1], 0)
Paint.MoveTo($hPicPanel.w, $Radius[1])
Paint.LineTo($hPicPanel.w, $hPicPanel.h - $Radius[2])
Paint.MoveTo($hPicPanel.w - $Radius[2], $hPicPanel.h)
Paint.LineTo($Radius[3], $hPicPanel.h)
Paint.MoveTo(0, $hPicPanel.h - $Radius[3])
Paint.LineTo(0, $Radius[0])
Paint.LineJoin = 1
Paint.Brush = Paint.Color($iBorderColor)
Paint.stroke(True)
Paint.End
'Content Adjust to bigger Radius
For Each n In $Radius
i = Max(n, i)
Next
iMargin = Int(i / 3)
With $Content
.X = iMargin
.Y = iMargin
.H = $hPicPanel.h - (iMargin * 2)
.W = $hPicPanel.w - (iMargin * 2)
End With
End