Join
Sign in
Search Options
Search Everything
Search Formats
Home
Blog
Resources
Forums
About Open XML
More ...
Home
»
Forums
»
Formats
»
SpreadsheetML
»
Add Image
Re: Add Image
Formats
Discussions about working with different Open XML Formats
Get this RSS feed
Details
2
Replies
0
Subscribers
Posted
over 3 years ago
Options
Subscribe via RSS
Share this
SpreadsheetML
Add Image
rated by 0 users
This post has
2 Replies |
0
Followers
Vento
35
Posted by
Vento
on
Thu, Dec 17 2009 7:51 AM
rated by 0 users
Post Points: 35
Add Image
Hello,
I am using the following code:
ImagePart imagePart = spreadSheet.WorkbookPart.WorksheetParts.First().Worksheet.WorksheetPart.AddImagePart(ImagePartType.Jpeg, "img1");
string sImagePath = @"C:\LOGO00002.jpg";
using (FileStream fs = new FileStream(sImagePath, FileMode.Open))
{
imagePart.FeedData(fs);
}
It adds the image on the package, but it is not displayed.
What's missing for it to be displayed?
Macilquham
185
Posted by
Macilquham
on
Mon, Feb 1 2010 11:26 PM
rated by 0 users
Post Points: 5
Re: Add Image
Hi Vento,
A little late but I have been working on a similar problem, the above code will add an image part to the package and write the file but its doesnt display the image, there is a good blog here on it
http://hastobe.net/blogs/stevemorgan/archive/2008/09/15/howto-insert-an-image-into-a-word-document-and-display-it-using-openxml.aspx
Cheers,
Jay
papaburger
125
Posted by
papaburger
on
Wed, Feb 24 2010 4:26 PM
rated by 0 users
Post Points: 5
Re: Add Image
you will need drawingML , and for spreadsheet you may need to choose oneCellAnchor, twoCellAnchor ... etc.
Page 1 of 1 (3 items)