Web Adresinden Bağlantılı Bir Resim Eklemek
Web Adresinden Bağlantılı Bir Resim Eklemek
Microsoft Excel Kullanımı
Microsoft Excel’de (örneğin 2007):
- Ekle menüsünü tıklayın ve Resim‘i seçin.
- Resim Ekle iletişim kutusunda resmin web adresini belirtin.
Resim eklenir.
Aspose.Cells for Java Kullanımı
Aspose.Cells for Java, bir bağlantılı resim eklemeyi ShapeCollection.addLinkedPicture(int upperLeftRow, int upperLeftColumn, int height, int width, java.lang.String sourceFullName) yöntemini destekler.
Yöntem bir Picture nesnesi döndürür.
Aşağıdaki örnek, bir elektronik tabloya hücre referansı üzerinden bağlantılı resim eklemenin nasıl yapılacağını göstermektedir.
Kodu çalıştırdıktan sonra, oluşturulan Excel dosyasında birinci çalışma sayfasında bağlantılı bir resim bulunur.
Çıkış dosyası
// 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"); |