summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index f9ead95..0346fe8 100644
--- a/README.md
+++ b/README.md
@@ -114,13 +114,21 @@ package main
import (
"fmt"
"os"
+ _ "image/gif"
+ _ "image/jpeg"
+ _ "image/png"
"github.com/Luxurioust/excelize"
)
func main() {
xlsx := excelize.CreateFile()
- err := xlsx.AddPicture("Sheet1", "A2", "H9", "/tmp/image.jpg")
+ // Insert a picture.
+ err := xlsx.AddPicture("Sheet1", "A2", "/tmp/image1.jpg", 0, 0, 1, 1)
+ // Insert a picture to sheet with scaling.
+ err = xlsx.AddPicture("Sheet1", "D2", "/tmp/image1.png", 0, 0, 0.5, 0.5)
+ // Insert a picture offset in the cell.
+ err = xlsx.AddPicture("Sheet1", "H2", "/tmp/image3.gif", 15, 10, 1, 1)
if err != nil {
fmt.Println(err)
os.Exit(1)