Web Adresinden Bağlantılı Resim Ekleme
Contents
[
Hide
]
Bazen web’den (http://) bir çalışma sayfasına bir resim eklemeniz gerekir. Bunu yapmak için resmin URL’sini belirtin ve resim, elektronik tablo Microsoft Excel’de her açıldığında indirilecektir. Görüntü fiziksel olarak Excel belgesine gömülü değildir, ancak bir web kaynağına işaret eder.
Microsoft Excel’i kullanma
Microsoft Excel’de (örneğin 2007):
- TıklaSokmak menü ve seçinResim.
- Resim Ekle iletişim kutusunda resmin web adresini belirtin.
Aspose.Cells for .NET’i kullanma
Aspose.Cells for .NET, şunu kullanarak bağlantılı bir resim eklemeyi destekler:ShapeCollection.AddLinkedPicture(int UpperLeftRow, int UpperLeftColumn, int heightPixels, int widthPixels, string sourceFullName) . Yöntem bir döndürürResimnesne.
Aşağıdaki örnek, bağlantılı resmin web adresinden bir çalışma sayfasına nasıl ekleneceğini gösterir.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |