We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Dependency of Picture.height on rowheight

Hi,

I am developing a report in which I have to display multiple Images in a row having varying sizes.
while I am adding Images,the output is dependent on row height .ie all my Images get the height of the row.what I want is Set the row height of the max row height of the image/picture which will not hamper the resolution of other images which are of less height in the same row.

Regards,
Chai

Hi,


I think you have to do it by yourself in your code. You have to set a row height or column width in accordance with your maximum sized picture’s height/width etc. See the sample code below:

Sample code:

//…
int index = workbook.Worksheets[0].Pictures.Add(1, 1, “e:\test\school.jpg”);
Aspose.Cells.Drawing.Picture pic = workbook.Worksheets[0].Pictures[index];
//Set the height and width of the cell as per the inserted image.
///workbook.Worksheets[0].Cells.SetColumnWidthInch(1, pic.WidthInch);
workbook.Worksheets[0].Cells.SetRowHeightInch(1, pic.HeightInch);
//Save the Excel file.
workbook.Save(@“e:\test2\out_PictureBook1.xls”);

Than you.

Hi Amjad,

Thanks for your prompt reply.
I got the solution by not limiting the size of picture to the cell by following.

picture.Placement = Aspose.Cells.Drawing.PlacementType.FreeFloating

Thanks Again,
Chai.

Hi,


Good to know that your have sorted it out by yourself. And, yes, if you need your picture should ignore to adjust its row/height with respect to row/column height / width, you may use free floating as picture’s placement type.

Thank you.