This article is a mirror article of machine translation, please click here to jump to the original article.

View: 46159|Reply: 5

[Console Program] Import Pictures to Excel Sheets Using NPOI [with Source Code]

[Copy link]
Posted on 11/18/2020 10:28:51 AM | | | |
Requirements: A certain column in Excel is an image, and the corresponding image needs to be inserted into the column.

First, look at the renderings:



In fact, I first read the image file as byte[], then convert it to base64 and then convert it to byte[] type, in fact, you can directly read the image as byte[] and insert it into the specified location.

The CreateAnchor method is mainly used, and the parameters are as follows:

CreateAnchor(int dx1, int dy1, int dx2, int dy2, short col1, int row1, short col2, int row2)

dx1 dy1 The x,y coordinates in the starting cell.

dx2 dy2 ends the x,y coordinates in the cell

col1,row1 specifies the starting cell, and the subscript starts from 0

col2,row2 specify the cell that ends with subscript starting from 0




Finally, attach the source code:

Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:Docker repository (2) Harbor settings to boot up
Next:Docker repository (3) pushes ASP.NET Core images to Harbor repositories
Posted on 7/24/2021 12:00:55 PM |
kan kan
Posted on 7/24/2021 12:22:59 PM |
OK!!!!
Posted on 9/26/2021 5:39:28 PM |
Posted on 10/8/2021 9:53:31 PM |
WPS XLS images cannot be imported, forum owners can try!   
Posted on 10/8/2021 10:02:18 PM |
WPS XLS images are all encrypted Text fields =DISPIMG("ID_C96822F1BA9941459A4FA5A4D8DAB51F",1)   Is there a good way for the forum owner...
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com