EXCELL 文档转换成图片,32 位图如何转换成 24 位图
Public Function ConvertExcelTOImage() As StringDim excelFilePath As String = "E:\Picture\运行图甲.xls"
Dim SaveExcelJPG As String = "E:\Picture\111.bmp"
Dim app As Microsoft.Office.Interop.Excel.Application = New Microsoft.Office.Interop.Excel.Application()
app.CutCopyMode = False
app.Visible = False
Dim objMis As Object = Type.Missing
Dim singleExcel As Microsoft.Office.Interop.Excel.Workbook = app.Workbooks.Open(excelFilePath, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis, objMis)
Try
Dim wsheet As Microsoft.Office.Interop.Excel.Worksheet = singleExcel.Worksheets(1)
Dim ranobj As Object = DBNull.Value
wsheet.Range("B2", "G3").Copy(ranobj)
Dim iData As IDataObject = Clipboard.GetDataObject()
Dim bits As Bitmap = iData.GetData(DataFormats.Bitmap)
Dim myBitmap As Bitmap = New Bitmap(bits.Width, bits.Height)
Dim g As Graphics = Graphics.FromImage(myBitmap)
g.DrawImage(bits, -1, -1)
myBitmap.Save(String.Format(SaveExcelJPG, Guid.NewGuid()))
Clipboard.Clear()
myBitmap.Dispose()
bits.Dispose()
Return ""
Catch ex As Exception
' KillProcess("EXCEL")
Return ex.Message
Finally
Clipboard.Clear()
' KillProcess("EXCEL")
End Try
End Function
上述程序是,将EXCELL文件转换成32位图图片,如何能让转换的图片是24位的呢?