I copy a chart from Excel to the clipboard and now want to save to a table. Problem is changing the format. I'm trying to save to two different formats to see if it makes a difference. col DImage is a varbinary(max) type and XChart is image type. Just testing to see what works. When I try to copy the image to either field I get an error trying to copy to a byte type. Does someone have a code example to convert the clipboard image to the right type?
Using VB.net 2005 with sql server 2005.
oChart.CopyPicture(Appearance:=Excel.XlPictureAppearance.xlScreen, Size:=Excel.XlPictureAppearance.xlScreen, Format:=Excel.XlCopyPictureFormat.xlBitmap)
Dim ClipImage As System.Drawing.Image
If My.Computer.Clipboard.ContainsImage() Then
ClipImage = My.Computer.Clipboard.GetImage
MsgBox("No Images in ClipBoard")
Dim row As DataRow
Dim intRCnt As Integer
intRCnt = 0
For Each row In dtDODICImages.Rows
If dtDImages.Rows(intRCnt).Item("DCD") = strDCD Then
dtDImages.Rows(intRCnt).Item("DImage") = ClipImage
dtDImages.Rows(intRCnt).Item("XChart") = ClipImage
intRCnt += 1