using img2xlsx: 3 images in a row
1 次查看(过去 30 天)
显示 更早的评论
hi everyone! i am using the function img2xlsx to export images (jpg) to excel. it works fine, but the problem is that i have a lot of jpgs that are positioned in a row next to each other. i would like to sort them like 3 in a row. how do i have to change my command (addimage=img2xlsx(array);) and define this? array is the array with image names. thanks
0 个评论
回答(1 个)
Walter Roberson
2016-5-15
img2xlsx appears to be from the File Exchange.
Notice in the description of it this part:
% 4. imgxlsx(imagcell, name, DIR, sheet, dimensions)
% varargin{4} = dimensions. Provide the dimensions of the image(s) in a
% matrix like [LinkToFile,... (The file to link to.)
% SaveWithDocument,... (To save the picture with the document.)
% Left,... (The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the document.)
% Top,... (The position (in points) of the upper-left corner of the picture relative to the top of the document.)
% Width,... (The width of the picture, in points.)
% Height] (The height of the picture, in points.)
% Default = [0,1,1,1,450,352]
% see: https://msdn.microsoft.com/en-us/library/bb209605(v=office.12).aspx
So what you need to do is call the routine multiple times for the same output file name, specifying a different input file name each time and specifying the "dimensions" position of where you want the image to appear.
2 个评论
Walter Roberson
2016-5-15
Use 0, 1 for the first two values.
The last two values should be the width and height of the image you are inserting.
The middle two values should be the upper left coordinate. That would be 1, 1 for the first picture; for the second picture to be placed right beside the first it should be 1 more than the width of the first picture for the first of the two and should be 1 for the second of the two. And so on. The third entry would always be 1 more than the total width of what is to the left of the picture you are putting in now, and the 5th and 6th entries would be the width and height of what you are putting in now.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!