Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Edited Unassigned: ExcelPicture.SetPosition(int Row, int RowOffsetPixels, int Column, int ColumnOffsetPixels); should position top left, not bottom right [15390]

$
0
0
I have some trouble with this method:
```
ExcelPicture.SetPosition(int Row, int RowOffsetPixels, int Column, int ColumnOffsetPixel)
```
Code example
```
ExcelPackage pck = new ExcelPackage();
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Test");
ExcelPicture picture = ws.Drawings.AddPicture("", Image.FromFile(Path.GetFullPath("..\\..\\Clown-Tux-icon.png")));
picture.SetPosition(1, 0, 1, 0);
pck.File = new FileInfo(Path.GetFullPath("..\\..\\test.xlsx"));
pck.Save();
```
I expect the image to start from the top left point in cell A1, but it does not. The image is placed in B2 instead (or bottom right A1, not sure).
![Image](http://i.imgur.com/i2wNtno.png?1)

It almost looks like SetPosition use zero indexed rows and columns, while excel and epplus in general don't. Example:
```
ws.Cells[new ExcelAddress(1, 1, 1, 1).Address].Value = "This will show up in A1";
```



Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>