End Google Ads 201810 - BS.net 01 -->
Hallo
I need help with my code ...
I read image from my picturebox to memorystream and next i want save this
image from memorystream to my xls file.
I dont now how,... i have forever same problem,xls file then show only
System.Drawing.Bitmap but image isnt show.
Here is my code..
Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;
try
{
oXL = new Excel.Application();
oWB = oXL.Workbooks.Open("C:\\tmp\\plan_udrzby.xlt", 1, false, 5,
"", "", true, Excel.XlPlatform.xlWindows,
"\t", false, false, 0, true, 1, 0);
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
DataRowView vypis = (DataRowView)machine_OverviewBindingSource.Current;
MemoryStream ms = new MemoryStream();
myPictureBox.Image.Save(ms, ImageFormat.Jpeg);
ms.Seek(0, SeekOrigin.Begin);
Image img = Image.FromStream(ms);
System.Windows.Forms.Clipboard.SetDataObject(img);
//Car
oSheet.Cells[3, 2] = vypis["Car"];
//Foto
oSheet.Cells[6, 2] = ; //Here i dont now
}
catch (Exception theException)
{
String errorMessage;
errorMessage = "Chyba: ";
errorMessage = String.Concat(errorMessage, theException.Message);
errorMessage = String.Concat(errorMessage, " ??dek: ");
errorMessage = String.Concat(errorMessage, theException.Source);
MessageBox.Show(errorMessage, "Chyba");
}
Can someone help my please
مواقع النشر (المفضلة)