Excel Yorumuna Resim Ekleme
Microsoft Excel, kullanıcıların elektronik tabloların görünümünü ve hissini büyük ölçüde özelleştirmesine olanak tanır. Yorumlara arka plan resimleri eklemek bile mümkündür.
Yorumlar, bir formülün nasıl çalıştığına, bir değerin nereden geldiğine veya gözden geçirenlerin sorularına ilişkin ayrıntılara kadar her şeyi kaydetmek için hücrelere yorumlar eklenir. Arka plan resmi eklemek estetik bir seçim olabilir veya marka bilincini güçlendirmek için kullanılabilir.
Microsoft Excel ile Excel Yorumuna resim ekleme
Microsoft Excel 2007 ile, bir hücre yorumuna arka plan olarak bir görüntüye sahip olmak mümkündür. Excel 2007’de bu şu şekilde gerçekleştirilir (yorumun zaten eklenmiş olduğu varsayılarak):
- Açıklamayı içeren hücreye sağ tıklayın.
- SeçmekYorumları Göster/Gizle ve yorumdaki tüm metni temizleyin.
- Seçmek için yorumun kenarlığına tıklayın.
- SeçmekBiçim , o zamanlarYorum Yap.
- Renkler ve Çizgiler sekmesinde,Renk.
- TıklamakDolgu Efektleri.
- Resim sekmesinde,Resim Seç.
- Resmi bulun ve seçin
- TıklamakTamam.
Aspose.Cells ile Excel Yorumuna resim ekleyin
Aspose.Cells bu değerli özelliği sağlar.
Aşağıdaki örnek kod, sıfırdan bir XLSX dosyası oluşturur ve A1 hücresine resim arka planıyla bir yorum ekler.
Kodu çalıştırdıktan sonra A1, arka plan resmi olan bir yoruma sahip olur.
çıktı dosyası
Basit 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"); |