Visual Basic.Net: HMI LedSingle Control OnPaint: drive.google.com/file/d/0B6mc... Buy HMI Professional Edition With Visual C#: play.google.com/store/apps/de...
The File on Google Drive was deleted: drive.google.com/file/d/0B6mc6hNRWHSSblk4OEN5aXNXS2s/view?usp=sharing The File "OnPaint.cs" can not be downloaded from Google Drive. The source code of the onPaint.cs file appears almost completely in the video. Only the overlong lines are missing, such as: Dim brush2 As Brush = DirectCast (New LinearGradientBrush (New Point (Math.Truncate (CDbl (pointf.X) - CDbl (num3))), CInt (Math.Truncate (pointf.Y) - CDbl (num3))), Brush ) These commands are incomplete because the display of source codes in the Visual Studio Editor is displayed without a line break. The following content of the onPaint.cs file could be recovered from the video: Protected Overrides Sub OnPaint(e As PaintEventArgs) MyBase.OnPaint(e) e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias Dim g As Graphics = e.Graphics Dim pointf As New PointF(CSng(Me.Width) / 2.0F, CSng(Me.Height) / 2.0F) Dim num1 As Single = Math.Min(pointf.X, pointf.Y) Dim num2 As Single = CSng(CDbl(num1) * 65.0 / 100.0) Dim num3 As Single = CSng(CDbl(num1) * 55.0 / 100.0) Dim num4 As Single = CSng(CDbl(num1) * 45.0 / 100.0) Dim _brush As Brush = DirectCast(New LinearGradientBrush(New Point(CInt(Math.Truncate(CDbl(pointf.X) - CDbl(num2))), CInt(Math.Truncate(CDbl(pointf.Y) - CDbl(num2))))), Brush) g.FillEllipse(_brush, pointf.X - num2, pointf.Y - num2, 2.0F * num2, 2.0F * num2) _brush.Dispose() If Me._Value Then Dim path As New GraphicsPath() path.AddEllipse(pointf.X - num1, pointf.Y - num1, num1 * 2.0F, num1 * 2.0F) Dim pathGradientBrush As New PathGradientBrush(path) Dim colorArray As Color() = New Color(0) {Color.FromArgb(1, CInt(Me.OnColor.R), CInt(Me.OnColor.G), CInt(Me.OnColor.B))} pathGradientBrush.SurroundColors = colorArray g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointf.X - num1, pointf.Y - num1, num1 * 2.0F, num1 * 2.0F) path.Dispose() pathGradientBrush.Dispose() End If Dim brush2 As Brush = DirectCast(New LinearGradientBrush(New Point(Math.Truncate(CDbl(pointf.X) - CDbl(num3))), CInt(Math.Truncate(pointf.Y) - CDbl(num3))), Brush) g.FillEllipse(brush2, pointf.X - num3, pointf.Y - num3, 2.0F * num3, 2.0F * num3) _brush.Dispose() Dim gp As New GraphicsPath() gp.AddEllipse(pointf.X - num4, pointf.Y - num4, num4 * 2.0F, num4 * 2.0F) If Me._Value Then Dim pathGradientBrush As New PathGradientBrush(gp) pathGradientBrush.CenterColor = Color.WhiteSmoke Dim ColorArray As Color() = New Color(0) {Me.OnColor} pathGradientBrush.SurroundColors = ColorArray pathGradientBrush.CenterPoint = New PointF(pointf.X - num4 / 2.0F, pointf.Y - num4 / 2.0F) g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointf.X - num4, pointf.Y - num4, 2.0F * num4, 2.0F * num4) pathGradientBrush.Dispose() Else Dim pathGradientBrush As New PathGradientBrush(gp) pathGradientBrush.CenterColor = Color.WhiteSmoke Dim colorArray As Color() = New Color(0) {Me.OffColor} pathGradientBrush.SurroundColors = colorArray pathGradientBrush.CenterPoint = New PointF(pointf.X - num4 / 2.0F, pointf.Y - num4 / 2.0F) g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointf.X - num4, pointf.Y - num4, 2.0F * num4, 2.0F * num4) pathGradientBrush.Dispose() End If gp.Dispose() End Sub
The File on Google Drive was deleted: drive.google.com/file/d/0B6mc6hNRWHSSblk4OEN5aXNXS2s/view?usp=sharing The File "OnPaint.cs" can not be downloaded from Google Drive. The source code of the onPaint.cs file appears almost completely in the video. Only the overlong lines are missing, such as: Dim brush2 As Brush = DirectCast (New LinearGradientBrush (New Point (Math.Truncate (CDbl (pointf.X) - CDbl (num3))), CInt (Math.Truncate (pointf.Y) - CDbl (num3))), Brush ) These commands are incomplete because the display of source codes in the Visual Studio Editor is displayed without a line break. The following content of the onPaint.cs file could be recovered from the video: Protected Overrides Sub OnPaint(e As PaintEventArgs) MyBase.OnPaint(e) e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias Dim g As Graphics = e.Graphics Dim pointF As New PointF(CSng(Me.Width) / 2.0F, CSng(Me.Height) / 2.0F) Dim num1 As Single = Math.Min(pointF.X, pointF.Y) Dim num2 As Single = CSng(CDbl(num1) * 65.0 / 100.0) Dim num3 As Single = CSng(CDbl(num1) * 55.0 / 100.0) Dim num4 As Single = CSng(CDbl(num1) * 45.0 / 100.0) Dim _Brush As Brush = DirectCast(New LinearGradientBrush(New Point(CInt(Math.Truncate(CDbl(pointF.X) - CDbl(num2))), CInt(Math.Truncate(CDbl(pointF.Y) - CDbl(num2))))), Brush) g.FillEllipse(_Brush, pointF.X - num2, pointF.Y - num2, 2.0F * num2, 2.0F * num2) _Brush.Dispose() If Me._Value Then Dim path As New GraphicsPath() path.AddEllipse(pointF.X - num1, pointF.Y - num1, num1 * 2.0F, num1 * 2.0F) Dim pathGradientBrush As New PathGradientBrush(path) Dim colorArray As Color() = New Color(0) {Color.FromArgb(1, CInt(Me.OnColor.R), CInt(Me.OnColor.G), CInt(Me.OnColor.B))} pathGradientBrush.SurroundColors = colorArray g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointF.X - num1, pointF.Y - num1, num1 * 2.0F, num1 * 2.0F) path.Dispose() pathGradientBrush.Dispose() End If Dim brush2 As Brush = DirectCast(New LinearGradientBrush(New Point(CInt(Math.Truncate(CDbl(pointF.X) - CDbl(num3))), CInt(Math.Truncate(CDbl(pointF.Y) - CDbl(num3))))), Brush) g.FillEllipse(brush2, pointF.X - num3, pointF.Y - num3, 2.0F * num3, 2.0F * num3) _Brush.Dispose() Dim gp As New GraphicsPath() gp.AddEllipse(pointF.X - num4, pointF.Y - num4, num4 * 2.0F, num4 * 2.0F) If Me._Value Then Dim pathGradientBrush As New PathGradientBrush(gp) pathGradientBrush.CenterColor = Color.WhiteSmoke Dim ColorArray As Color() = New Color(0) {Me.OnColor} pathGradientBrush.SurroundColors = ColorArray pathGradientBrush.CenterPoint = New PointF(pointF.X - num4 / 2.0F, pointF.Y - num4 / 2.0F) g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointF.X - num4, pointF.Y - num4, 2.0F * num4, 2.0F * num4) pathGradientBrush.Dispose() Else Dim pathGradientBrush As New PathGradientBrush(gp) pathGradientBrush.CenterColor = Color.WhiteSmoke Dim colorArray As Color() = New Color(0) {Me.OffColor} pathGradientBrush.SurroundColors = colorArray pathGradientBrush.CenterPoint = New PointF(pointF.X - num4 / 2.0F, pointF.Y - num4 / 2.0F) g.FillEllipse(DirectCast(pathGradientBrush, Brush), pointF.X - num4, pointF.Y - num4, 2.0F * num4, 2.0F * num4) pathGradientBrush.Dispose() End If gp.Dispose() End Sub **Obs: There is something missing from these lines, who can help? Because you are generating an error: "Error 2 Overload resolution failed because no accessible 'New' accepts this number of arguments".
Not completely. There is a part of the code that is hidden because the line of code is too long and does not have a line break. I sent an email with a request, if you can verify. They are exactly the declarations of the variables "_Brush" and "brush2".