-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to insert a picture into a cell? #1860
Comments
No, because Excel doesn't embed pictures in cells; they're "overlaid" above the cells, but linked to the cells. When you add an image, you link it to a cell address:
Links the added image to cell address |
thanks |
Please explain what you want to do and what you think is wrong. |
I mean, after using the code you provided. This is still the case: the picture overlaps above the cell. I loop the contents of the database into the cells. The image is stored in the server. |
That's the point; Excel does not store its images in the cells, but in a layer on top of the cell; so yes, images can overlap unless you size them correctly so that they "fit" the cell dimensions |
Okay, I already know what to do. I will set the size of the cell to resize the inserted picture. But when I insert a picture, office retains the aspect ratio of the picture. Can PhpSpreadsheet resize the picture to insert it into the cell at will? |
The Drawing class has height and width attributes.
Or you need to increase the column width or row height. You might be helped by displaying a picture in a comment (when hovering over a cell), but this functionality is not implemented. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Closing. No update since March, and the instructions already provided seem adequate. Also, PR #2422 now allows use of image with comments. |
When I insert the picture, it's not embedded in the cell.
The text was updated successfully, but these errors were encountered: