You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: