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

Free Support Forum - aspose.com

Get initial size picture

Hi !
I want to get width and height of a picture on my word document.
My picture is into a Shape or InlineShape object :

shapes = doc.GetChildNodes(NodeType.Shape, true);
foreach (Shape shape in shapes)
{
// Si c’est une image dans le corps du document
if (shape.ImageFormat != null && shape.GetAncestor(typeof(Body)) != null)
{

shape.ImageFormat.InitialHeight ???
}
}

Can I’ve got width and height of my picture ? And specially the initial size.
Thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I think you can use ImageData.ImageSize. Please see the following link for more information.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.drawing.imagedata.imagesize.html

I hope this helps.

Best regards.

And if ImageData doesn’t exists ?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You can use Shape.Width and Shape.Height.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.drawing.shapebase.width.html

Best regards.