إدراج صورة ربط من عنوان الويب

إدراج صورة مُربّطة من عنوان الويب

استخدام Microsoft Excel

في Microsoft Excel (على سبيل المثال 2007):

  1. انقر فوق قائمة إدراج وحدد صورة.

todo:image_alt_text

  1. حدد عنوان الويب للصورة في مربع حوار إدراج صورة.

todo:image_alt_text

سيتم إدراج الصورة.

todo:image_alt_text

باستخدام Aspose.Cells for Java

Aspose.Cells for Java يدعم إضافة صورة مرتبطة باستخدام الطريقة ShapeCollection.addLinkedPicture(int upperLeftRow, int upperLeftColumn, int height, int width, java.lang.String sourceFullName).

تُعيد الطريقة كائن Picture.

المثال التالي يوضح كيفية إضافة صورة مرتبطة من عنوان الويب إلى ورقة عمل.

بعد تشغيل الكود، يحتوي ملف Excel الذي تم إنشاؤه على صورة مرتبطة في ورقة العمل الأولى.

ملف الإخراج

todo:image_alt_text

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(InsertLinkedPicturefromWebAddress.class);
// Instantiate a new Workbook.
Workbook workbook = new Workbook();
// Insert a linked picture (from Web Address) to B2 Cell.
Picture pic = (Picture) workbook.getWorksheets().get(0).getShapes().addLinkedPicture(1, 1, 100, 100,
"http://www.aspose.com/Images/aspose-logo.jpg");
// Set the source of the inserted image.
pic.setSourceFullName("http://www.aspose.com/images/aspose-logo.gif");
// Set the height and width of the inserted image.
pic.setHeightInch(1.04);
pic.setWidthInch(2.6);
// Save the Excel file.
workbook.save(dataDir + "LinkedPicture.xlsx");