Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

AnchorType.MoveDontResize does not work correctly when we set custom row height #156

Open
majidmadadi opened this issue Dec 18, 2019 · 0 comments

Comments

@majidmadadi
Copy link

When I change row height the image height also grows. My code is as the following:

private void AddImageToWorkBook(Image img, int colIndex, int rowIndex, XSSFWorkbook workbook, ISheet sheet) { var ms = new MemoryStream(); img.Save(ms, ImageFormat.Png); byte[] data = ms.ToArray(); int pictureIndex = workbook.AddPicture(data, PictureType.PNG); ICreationHelper helper = workbook.GetCreationHelper(); IDrawing drawing = sheet.CreateDrawingPatriarch(); IClientAnchor anchor = helper.CreateClientAnchor(); anchor.AnchorType = AnchorType.MoveDontResize; anchor.Col1 = colIndex;//0 index based column anchor.Row1 = rowIndex;//0 index based row IPicture picture = drawing.CreatePicture(anchor, pictureIndex); picture.Resize(); }

When I change the row height before or after calling this function, then the generated image will grow too while I've set the AnchorType to MoveDontResize.
Expected behavior: Image size should not grow with row height.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant