Table of Contents

Class ImageEditingExtensions

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

A picture already in the document resized, moved or copied, as DocumentEdits: each can be undone exactly and names the paragraphs it changed, as the edits of StructureEditingExtensions do.

public static class ImageEditingExtensions
Inheritance
ImageEditingExtensions
Inherited Members

Remarks

The DOCX writer re-emits a picture's preserved w:drawing island, not its modelled geometry, so a resize rewrites the island's size attributes in place (the drawing's wp:extent and the picture's a:ext, matched by namespace) and leaves every other byte of it alone.

A move takes the picture node itself to the new place, so its alternative text, crop, effects, island and relationship go with it; a copy is a clone with a drawing id of its own that shares the relationship. Both stay in the package part the picture is in, because a relationship belongs to one part.

Fields

FullTurn

A whole turn in the 60000ths of a degree a picture's rotation counts.

MaxAnchorDistance

The largest distance from text, offset or simple position Word accepts for a floating picture: 22 inches either way.

MaxImageSide

The largest displayed side Word accepts for a picture: 22 inches.

Methods

CopyImage(WordDocument, ImageRef, DocumentPosition)

Puts a copy of a picture at a position, as Ctrl+dragging it does in Word.

IsImageDecorative(ImageRef)

Whether a picture is marked decorative (Word's Mark as Decorative; Phase 176, WQ-0157).

MoveImage(WordDocument, ImageRef, DocumentPosition)

Moves a picture to a position, as dragging it does in Word.

NewFloatingAnchor()

The anchor Word gives a picture it takes out of the line of text: in front of text, at the start of its column and its paragraph, 0.125 in from text on the left and the right.

ReanchorImage(WordDocument, ImageRef, Paragraph, ImageAnchor)

Moves a floating picture's anchor to the start of another paragraph and gives it a position there, as dragging the picture does in Word (Phase 176, WQ-0157: the anchor goes to the paragraph at the picture's new top edge, at its start). One undo step.

ResizeImage(WordDocument, ImageRef, Emu, Emu)

Sets the displayed size of a picture.

SetImageAlternativeText(WordDocument, ImageRef, string?, string?)

Sets a picture's alternative text and its title, as Word's Alt Text pane does.

SetImageCrop(WordDocument, ImageRef, int, int, int, int)

Crops a picture: how much of its source is cut from each side, as Word's Crop tool does.

SetImageDecorative(WordDocument, ImageRef, bool)

Marks a picture decorative, or not, as Word's Alt Text pane does (Phase 176, WQ-0157): a decorative picture is one a screen reader skips, so marking it removes its alternative text.

SetImageLayout(WordDocument, ImageRef, ImageAnchor?)

Sets how a picture sits in the text: in line with it, or floating with a wrap, a position and a distance from text.

SetImageRotation(WordDocument, ImageRef, int, bool, bool)

Sets a picture's rotation and whether it is mirrored, as Word's Rotate menu does.