Picture Placement Types

Hi,

I want to know about differant placement Type for Image in Aspose Cells.
i.e what is the differance between FreeFloating,Move and ‘Move and size’ enums ?

Regards,
Chaitanya

Hi,


Well, an image’s Placement type determine the way the picture/control is attached to the cells or how it is placed in the cells in the worksheet.
i) Free floating --> it refers that if you change the cell(s) height or width, the image won’t change its height or width accordingly.
ii) Move(but do not size) --> it refers that if you change the cell(s) height or width, the image can be moved into the cell(s) if you want but it won’t change its height or width in accordance with the cells.
iii) Move and size) --> it refers that if you change the cell(s) height or width, the image will change its height or width / decrease or increase height/width accordingly.

You may insert an image into the Excel worksheet’s cells and right click on the picture and click “Size and Properites” to open the dialog and then click the “Properties” tab to exercise to better understand the options.

Hope, it helps.

Thank you.

Hi,


I am interested in the second option “Move(but do not size)”.
Can you please provide me any example code?

I want to insert multiple images in same cell which i achieved by using
"picture.Top" but same images when i inserted in another cell they are looking bigger in size.


Thank You.

Hi,


See the sample code below for your reference:

e.g

Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
int index = worksheet.Pictures.Add(3,6, 4, 7,“d:\test\school.jpg”);
Picture pic = worksheet.Pictures[index];
//Set the picture’s height and width
pic.WidthPt = 200;
pic.HeightPt = 300;

pic.Placement = PlacementType.Move;
worksheet.Cells.SetRowHeight(3,150);
workbook.Save(“e:\test2\out1.xls”);


Also, see the document for your further reference:
http://www.aspose.com/docs/display/cellsnet/Adding+Pictures

Thank you.