Dim file As String = e.DataRow("路径文件名")
' MessageBox.Show(file)
If FileSys.FileExists(file) Then
Dim img As image = getImage(file)
Dim PICH As Integer = img.Height.ToString()
Dim PICW As Integer = img.Width.ToString()
If file.EndsWith(".jpg") OrElse file.EndsWith(".png") Then
e.DataRow("图像大小")= PICH & "*" & PICW & "DPI"
If Math.Round((PICW * PICH)/(2480*3507),1) < 1.2 Then ’感觉主要出错在此段
e.DataRow("折算A4页数量") = 1
' MessageBox.Show(Math.Round((PICW * PICH)/(2480*3507),1))
ElseIf Math.Round((PICW * PICH)/(2480*3507),1) >= 1.2 AndAlso Math.Round((PICW * PICH)/(2480*3507),1) <= 1.8 Then
e.DataRow("折算A4页数量") = 2
ElseIf Math.Round((PICW * PICH)/(2480*3507),1) > 1.8 AndAlso Math.Round((PICW * PICH)/(2480*3507),1) <= 2.4 Then
e.DataRow("折算A4页数量") = 3
ElseIf Math.Round((PICW * PICH)/(2480*3507),1) >2.4 AndAlso Math.Round((PICW * PICH)/(2480*3507),1) <= 3.4 Then
e.DataRow("折算A4页数量") = 4
Else
e.DataRow("折算A4页数量") = 5
End If
End If
Else
e.DataRow("图像大小") = " "
' MessageBox.Show(4)
End If
[此贴子已经被作者于2020/9/25 18:02:00编辑过]