Chrome瀏覽器簡易除錯方式,
本篇圖片眾多,請小心服用。
本篇圖片眾多,請小心服用。
e.Graphics.MeasureString(title,New Font("Arial", 24.0F, FontStyle.Bold), e.MarginBounds.Width).Width
dim ypos as integer = New Font("Arial", 16.0F, FontStyle.Underline).GetHeight
Dim LinePen As New Pen(Color.Black, 1)
Dim lineDash As Single() = {10, 2} '實線長度、虛線長度(loop)
LinePen.DashStyle = Drawing2D.DashStyle.Custom
LinePen.DashPattern = lineDash
e.Graphics.DrawLine(LinePen, New Point(e.MarginBounds.Left, yPos), New PointF(e.MarginBounds.Right, yPos))
e.Graphics.DrawString(String.Format("Cpk製程能力總和指數:{0}\t{1}", txtCpk.Text, txtCpkLv.Text).Replace("\t", vbTab), New Font(dg.Font, FontStyle.Bold), Brushes.Black,e.MarginBounds.Left + 261, yPos)
string.format("{1}{0}{2}{0}",a,vbTab,2,vbTab)
For Each GridCol As DataGridViewColumn In dg.Columns
e.Graphics.FillRectangle(New SolidBrush(Color.LightGray), New Rectangle(CInt(arrColumnLeft(iCount)),
iTopMargin, CInt(arrColumnWidth(iCount)), iHeaderHeight)) e.Graphics.DrawRectangle(Pens.Black, New Rectangle(CInt(arrColumnLeft(iCount)), iTopMargin,
CInt(arrColumnWidth(iCount)), iHeaderHeight))
e.Graphics.DrawString(GridCol.HeaderText, GridCol.InheritedStyle.Font,
New SolidBrush(GridCol.InheritedStyle.ForeColor),
New RectangleF(CInt(arrColumnLeft(iCount)), iTopMargin,
CInt(arrColumnWidth(iCount)), iHeaderHeight), strFormat)
iCount += 1
Next
'將chart轉成圖檔
dataChart.DrawToBitmap(bmp, New Rectangle(0, 0, dataChart.Width, dataChart.Height))
e.Graphics.DrawImage(DirectCast(dest_bmp, Image), e.PageBounds.Left + 20, yPos)
dataChart.Series("Series1").Points.Clear()
dataChart.ChartAreas.Clear()
dataChart.ChartAreas.Add("ChartArea1")
Dim arrWT As Decimal() = CommonHelp.GetTypeStd(txtStd.Text)
Dim intWT_std = arrWT(0), intWT_T = arrWT(1)
Dim ChtLSL = intWT_std - intWT_T, ChtTGT = intWT_std, ChtUSL = intWT_std + intWT_T
Dim chartMin = chartRange(intWT_T)(0), chartMax = chartRange(intWT_T)(1)
'設定MainCht
With dataChart
.Series("Series1").MarkerStyle = MarkerStyle.Circle
.ChartAreas(0).AxisX.MajorGrid.Enabled = False
.ChartAreas(0).AxisY.MajorGrid.Enabled = False
.ChartAreas(0).AxisX.MajorTickMark.Enabled = False
.ChartAreas(0).AxisY.MajorTickMark.Enabled = False
.ChartAreas(0).AxisX.LabelStyle.ForeColor = Color.Black
.ChartAreas(0).InnerPlotPosition.Auto = True
.Legends.Clear()
'最大、最小
.ChartAreas(0).AxisY.Minimum = ChtLSL - 20
.ChartAreas(0).AxisY.Maximum = ChtUSL + 20
'把圖表駔標的左右兩邊空白去除
.ChartAreas(0).AxisX.IsMarginVisible = True
.ChartAreas(0).AxisY.IsMarginVisible = True
'X軸最大的資料點總數
.ChartAreas(0).AxisX.Maximum = 100
'X軸從0開始
.ChartAreas(0).AxisX.Minimum = 0
.ChartAreas(0).AxisX.Interval = 10
'塞滿mschart
.ChartAreas(0).Position.Width = 95
.ChartAreas(0).Position.Height = 90
''Y軸標籤
'first row are dummy labels to suppress axis numberics
'.ChartAreas(0).AxisY.CustomLabels.Add(30, 40, "", 0, LabelMarkStyle.LineSideMark)
.ChartAreas(0).AxisY.CustomLabels.Add(ChtLSL, ChtLSL + 1, "LSL(" & ChtLSL.ToString & ")") 'LSL
.ChartAreas(0).AxisY.CustomLabels.Add(ChtTGT, ChtTGT + 1, "TGT(" & ChtTGT.ToString & ")") 'TGT
.ChartAreas(0).AxisY.CustomLabels.Add(ChtUSL, ChtUSL + 1, "USL(" & ChtUSL.ToString & ")") 'USL
.ChartAreas(0).AxisY.LabelAutoFitStyle = LabelAutoFitStyles.None
'Set series chart type
.Series("Series1").ChartType = SeriesChartType.Point
''加橫線
For LineRow As Integer = 1 To 3
Dim sl1 As StripLine = New StripLine
sl1.BackColor = Color.Black
sl1.StripWidth = 0.25
Select Case LineRow
Case 1
sl1.IntervalOffset = ChtLSL
Case 2
sl1.IntervalOffset = ChtTGT
Case 3
sl1.IntervalOffset = ChtUSL
End Select
.ChartAreas(0).AxisY.StripLines.Add(sl1)
Next
End With