/ Published in: C#

URL: http://www.aspose.com/docs/display/cellscloud/Add+Pictures+to+Excel+Worksheet
This example shows how to add a picture to a worksheet using Aspose.Cells for Cloud API in your applications. You can use our REST API with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more.
Expand |
Embed | Plain Text
//sepcify App SID AsposeApp.AppSID = "77******-1***-4***-a***-80**********"; //sepcify App Key AsposeApp.AppKey = "********************************"; //build URI string strURI = "http://api.aspose.com/v1.1/cells/Sample.xlsx/worksheets/Sheet1/pictures?upperLeftRow=5&upperLeftColumn=5&lowerRightRow=20&lowerRightColumn=20&picturePath=Dock.jpg"; //sign URI string signedURI = Utils.Sign(strURI); Stream responseStream = Utils.ProcessCommand(signedURI, "PUT"); //build URI strURI = "http://api.aspose.com/v1.1/storage/file/Sample.xlsx"; //sign URI signedURI = Utils.Sign(strURI); responseStream = Utils.ProcessCommand(signedURI, "GET"); using (Stream fileStream = System.IO.File.OpenWrite(@"Sample.xlsx")) { Utils.CopyStream(responseStream, fileStream); } responseStream.Close(); /// <summary> /// Copies the contents of input to output. Doesn't close either stream. /// </summary> public static void CopyStream(Stream input, Stream output) { try { int len; while ((len = input.Read(buffer, 0, buffer.Length)) > 0) { output.Write(buffer, 0, len); } } catch (Exception ex) { } }
You need to login to post a comment.