[]
IDWriteInlineObject
[Guid("8339FDE3-106F-47ab-8373-1C6295EB10B3")]
public class InlineObjectNative : ComObjectCallback, IUnknown, IInlineObject, ICallbackable, IDisposable
Initializes a new instance of the InlineObjectNative class.
public InlineObjectNative(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
TextLayout calls this callback function to get the measurement of the inline object.
public InlineObjectMetrics Metrics { get; }
a structure describing the geometric measurement of anapplication-defined inline object. These metrics are in relation to the baseline of the adjacent text.
TextLayout calls this callback function to get the visible extents (in DIPs) of the inline object. In the case of a simple bitmap, with no padding and no overhang, all the overhangs will simply be zeroes.
public OverhangMetrics OverhangMetrics { get; }
Overshoot of visible extents (in DIPs) outside the object.
The application implemented rendering callback (DrawInlineObject(object, float, float, IInlineObject, bool, bool, IntPtr)) can use this to draw the inline object without needing to cast or query the object type. The text layout does not call this method directly.
public void Draw(object clientDrawingContext, ITextRenderer renderer, float originX, float originY, bool isSideways, bool isRightToLeft, IntPtr clientDrawingEffectPtr)
clientDrawingContext
objectThe drawing context passed to GrapeCity.Documents.DX.DirectWrite.TextLayout.Draw_(System.IntPtr,System.IntPtr,System.Single,System.Single). This parameter may be NULL.
renderer
ITextRendererThe same renderer passed to GrapeCity.Documents.DX.DirectWrite.TextLayout.Draw_(System.IntPtr,System.IntPtr,System.Single,System.Single) as the object's containing parent. This is useful if the inline object is recursive such as a nested layout.
originX
floatThe x-coordinate at the upper-left corner of the inline object.
originY
floatThe y-coordinate at the upper-left corner of the inline object.
isSideways
boolA Boolean flag that indicates whether the object's baseline runs alongside the baseline axis of the line.
isRightToLeft
boolA Boolean flag that indicates whether the object is in a right-to-left context and should be drawn flipped.
clientDrawingEffectPtr
System.IntPtrThe drawing effect set in TextLayout.SetDrawingEffect. Usually this effect is a foreground brush that is used in glyph drawing.
Layout uses this to determine the line-breaking behavior of the inline object among the text.
public void GetBreakConditions(out BreakCondition breakConditionBefore, out BreakCondition breakConditionAfter)
breakConditionBefore
BreakConditionWhen this method returns, contains a value which indicates the line-breaking condition between the object and the content immediately preceding it.
breakConditionAfter
BreakConditionWhen this method returns, contains a value which indicates the line-breaking condition between the object and the content immediately following it.
Performs an explicit conversion from System.IntPtr to InlineObjectNative.
public static explicit operator InlineObjectNative(IntPtr nativePointer)
nativePointer
System.IntPtr