c# .Net, Shapes.AddPicture to Excel worksheet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • girlswannahavefun
    New Member
    • Aug 2007
    • 4

    c# .Net, Shapes.AddPicture to Excel worksheet

    Hello everyone! Hope you can help me.
    My asp.net application seems to hang when trying to insert a picture. The webpage just kind of keeps loading and loading and then freezes.

    This is the code:
    Code:
    System.Drawing.Image originalBitmap = System.Drawing.Image.FromFile(picFile, true);
    eWorksheet.Shapes.AddPicture(picFile, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 370, 100, originalBitmap.Width, originalBitmap.Height);
    picFile is a string with the location of the .jpeg file.

    What i have noticed is that when i try to insert a picture of a rather small size (lets say 200x200 pixels) then it works fine!
    Why is that? Shouldn't i be able to insert a larger picture?
Working...