Use C# read images from spreadsheet

Posted by Cc9530 under C# on 12/22/2010 | Points: 10 | Views : 1395 | Status : [Member] | Replies : 3
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

i could be the one


Responses

Posted by: T.saravanan on: 12/22/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Cc9530,

Thanks for sharing your Concept.Its really helpful to any one.

Thanks,
T.Saravanan

Cc9530, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/6/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Good code... thanks much

Thanks
Karthik
www.f5Debug.net

Cc9530, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chvrsri on: 1/6/2011 [Member] [Moderator] [MVP] Silver | Points: 25

Up
0
Down
Hi Cc9530,

Your code might be very useful but , if u place it in Code Section it would be more better. Can u imagine booking a train ticket and going to a Bus Stand to board the train ? This is just like that.

Generally Users search codes at Codes Section . I feel your work shouldn't be wasted , so i kindly request you too move this post to codes Section . Then it will be used by many memebrs.

This is just my suggestion .

Hope you got my Point !!!

Thanks,
Radha Srikanth

Cc9530, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response