Verknüpftes Bild aus Webadresse einfügen

Verwendung von Microsoft Excel

In Microsoft Excel (zum Beispiel 2007):

  1. Klicken Sie auf das Einfügen Menü und wählen Sie Bild aus.
  2. Geben Sie die Webadresse für das Bild im Dialogfeld Bild einfügen an.

Verwendung von Aspose.Cells for .NET

Aspose.Cells for .NET unterstützt das Hinzufügen eines verknüpften Bildes mit Hilfe des ShapeCollection.AddLinkedPicture(int upperLeftRow, int upperLeftColumn, int heightPixels, int widthPixels, string sourceFullName). Die Methode gibt ein Picture Objekt zurück.

Das folgende Beispiel zeigt, wie ein verknüpftes Bild von einer Webadresse in ein Arbeitsblatt eingefügt wird.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Instantiate a new Workbook.
Workbook workbook = new Workbook();
// Insert a linked picture (from Web Address) to B2 Cell.
Aspose.Cells.Drawing.Picture pic = workbook.Worksheets[0].Shapes.AddLinkedPicture(1, 1, 100, 100, "http:// Www.aspose.com/Images/aspose-logo.jpg");
// Set the height and width of the inserted image.
pic.HeightInch = 1.04;
pic.WidthInch = 2.6;
// Save the Excel file.
workbook.Save(dataDir+ "outLinkedPicture.out.xlsx");