Excel Yorumuna Resim Ekle
Microsoft Excel, elektronik tabloların görünümünü geniş ölçüde özelleştirme olanağı sunar. Yorumlara arka plan resmi eklemek bile mümkündür.
Yorumlar, formülün nasıl çalıştığından bir değerin nereden geldiğine veya inceleyicilerden gelen sorulara kadar her şeyi kaydetmek için hücrelere eklenir. Arka plan resmi eklemek estetik bir tercih olabilir veya markalaşmayı güçlendirmek için kullanılabilir.
Microsoft Excel ile Excel Yorumuna Resim Ekleme
Microsoft Excel 2007 ile bir hücre yorumuna bir resim arka plan olarak eklemek mümkündür. Excel 2007’de bu (yorum zaten eklenmişse) şu şekilde gerçekleşir:
- Yorum içeren hücreye sağ tıklayın.
- Yorumları Göster/Gizle‘yi seçin ve yorumdan herhangi bir metni temizleyin.
- Yorumun kenarına tıklayın.
- Biçim, ardından Yorum‘u seçin.
- Renkler ve Çizgiler sekmesinde, Renk için oku tıklayın.
- Dolgu Efektleri‘ni tıklayın.
- Resim sekmesinde, Resim Seç‘i tıklayın.
- Resmi bulun ve seçin
- Tamam‘a tıklayın.
Aspose.Cells ile Excel Yorumuna Resim Ekleme
Aspose.Cells bu değerli özelliği sağlar.
Aşağıdaki örnek kod, baştan bir XLSX dosyası oluşturur ve A1 hücresine arka plan resimli bir yorum ekler.
Kodun çalıştırılmasından sonra, A1’in arka plan resimli bir yorumu vardır.
Çıkış dosyası
Örnek Kod
// 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.getSharedDataDir(AddPicturetoExcelComment.class) + "articles/"; | |
// Instantiate a Workbook | |
Workbook workbook = new Workbook(); | |
// Get a reference of comments collection with the first sheet | |
CommentCollection comments = workbook.getWorksheets().get(0).getComments(); | |
// Add a comment to cell A1 | |
int commentIndex = comments.add(0, 0); | |
Comment comment = comments.get(commentIndex); | |
comment.setNote("First note."); | |
comment.getFont().setName("Times New Roman"); | |
// Load/Read an image into stream | |
String logo_url = dataDir + "school.jpg"; | |
// Creating the instance of the FileInputStream object to open the logo/picture in the stream | |
FileInputStream inFile = new FileInputStream(logo_url); | |
// Setting the logo/picture | |
byte[] picData = new byte[inFile.available()]; | |
inFile.read(picData); | |
// Set image data to the shape associated with the comment | |
comment.getCommentShape().getFill().setImageData(picData); | |
// Save the workbook | |
workbook.save(dataDir + "APToExcelComment_out.xlsx"); |