Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{description}
{excerpt}This class is used to represent an inline image in a Word document. The types of images that Word supports are jpg, png, bmp, and gif.  Inline images are part of the _InlineElement_ objects of an [Element|Element].{excerpt}
{signature:C#}
 public sealed class InlineImage : Element
{signature}{signature:vb.net}
Public NotInheritable Class InlineImage
		Inherits Element
{signature}
{remarks}To create a new inline image, use the insert methods for inline images from the {{Element}} or [Position|Position] class.

{remarks}
{example}
The following sample demonstrates creating a inline image at the end of a new document and retrieving the first inline image of an existing document.
{code:csharp|title=C#}

          //--- Insert a inline image at the end of a new document
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          InlineImage image = doc.InsertImageAfter(@"C:\sample.jpg");

          //--- Get the first inline image of an existing document
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          InlineImage firstImage =
               (InlineImage)doc.GetElements(Element.Type.InlineImage)[0];
        {code}
{code:vb.net|title=vb.net}

          '--- Insert an inline image at the end of a new document
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim image As InlineImage = doc.InsertImageAfter("C:\sample.jpg")

          '--- Get the first inline image of an existing document
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim firstImage As InlineImage = _
               doc.GetElements(Element.Type.InlineImage)(0)
        {code}

{example}
{properties}
||Name||Description||
|[Height|InlineImage.Height]|{excerpt-include:InlineImage.Height|nopanel=true}|
|[Image|InlineImage.Image]|{excerpt-include:InlineImage.Image|nopanel=true}|
|[ImageFormat|InlineImage.ImageFormat]|{excerpt-include:InlineImage.ImageFormat|nopanel=true}|
|[Width|InlineImage.Width]|{excerpt-include:InlineImage.Width|nopanel=true}|
{methods}
||Name||Description||
|[GetImage(InlineImage.Format)|InlineImage.GetImage(InlineImage.Format)]|{excerpt-include:InlineImage.GetImage(InlineImage.Format)|nopanel=true}|
{classes}
||Name||Description||
|[Format|InlineImage.Format]|{excerpt-include:InlineImage.Format|nopanel=true}|