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

Free Support Forum - aspose.com

Picture size and positionning on a spreadsheet

Hi,

I am having problems while putting a picture on a spreadsheet.

I use

ws.Pictures[0].Width=63

ws.Pictures[0].Height=20

my original picture zize is (63 pixels width X 20 pixels height)

and depending on what cell I add my picture the results are different

If I add ws.Pictures.Add(0,0,"mypic.bmp") in cell A1

is diferent than ws.Pictures.Add(0,1,"mypic.bmp") if add picture in cell B1

How can I control the picture size to be absolute and not relative to the cell size?

Thanks

Hi,

You can grow and shrink picture as well as you can do absolute or relative positioning.

Please refer to this document for more help.

Adding Pictures

How can you make a 63x20 picture maintain it size no mather where it is inserted

Article on inserting pictures doesn't address that.

Thanks

Hi,

I think, Ms-Excel shrinks the picture. Please manually create your desired xlsx file using Ms-Excel and post here. We will check it asap.

I got it to look ok using trial and error

like this substracting diferent numbers until it look ok

ws.Pictures[0].Width = ws.Pictures[1].OriginalWidth-12;

ws.Pictures[0].Height = ws.Pictures[1].OriginalHeight-3;

BUT

can't fully control picture behavior with available methods

Thanks,

Hi,

It’s great your problem is sorted out. If you need any further help then please provide us your desired xls/xlsx file. We will look into it and help you asap.