General discussion

Locked

Use C# to read images from spreadsheet

By stephen9530 ·
c# source:

01 private void btnRun_Click(object sender, System.EventArgs e)
02 {
03 Workbook workbook = new Workbook();
04 workbook.LoadFromFile(@"..\..\..\..\..\..\Data\ImageSample.xls");
05 Worksheet sheet = workbook.Worksheets[0];
06
07 ExcelPicture pic = sheet.Pictures[0];
08
09 using( Form frm1 = new Form())
10 {
11 PictureBox pic1 = new PictureBox();
12 pic1.Image = pic.Picture;
13 frm1.Width = pic.Picture.Width;
14 frm1.Height = pic.Picture.Height;
15 frm1.StartPosition = FormStartPosition.CenterParent;
16 pic1.Dock = DockStyle.Fill;
17 frm1.Controls.Add(pic1);
18 frm1.ShowDialog();
19 }
20 }
21
22 private void ExcelDocViewer( string fileName )
23 {
24 try
25 {
26 System.Diagnostics.Process.Start(fileName);
27 }
28 catch{}
29 }

codes from e-iceblue
http://www.e-iceblue.com/Knowledgebase/Spire.XLS/Demos/Images.html

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Windows Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums