Bitmap for UWP
DrawUnderline(Object,Single,Single,GlyphOrientationAngle,Underline,IntPtr) メソッド

C1.UWP.DX アセンブリ > C1.Util.DX.DirectWrite 名前空間 > TextRenderer1Base クラス > DrawUnderline メソッド : DrawUnderline(Object,Single,Single,GlyphOrientationAngle,Underline,IntPtr) メソッド
The application-defined drawing context passed to IDWriteTextLayout::Draw.
The pixel location (X-coordinate) at the baseline origin of the run where underline applies.
The pixel location (Y-coordinate) at the baseline origin of the run where underline applies.
Orientation of the underline.
Pointer to a structure containing underline logical information.
Application-defined effect to apply to the underline. Usually this argument represents effects such as the foreground brush filling the interior of a line.
IDWriteTextLayout::Draw calls this function to instruct the client to draw an underline.
シンタックス
'宣言
 
Public Overloads Overridable Function DrawUnderline( _
   ByVal clientDrawingContext As System.Object, _
   ByVal baselineOriginX As System.Single, _
   ByVal baselineOriginY As System.Single, _
   ByVal orientationAngle As GlyphOrientationAngle, _
   ByRef underline As Underline, _
   ByVal clientDrawingEffectPtr As System.IntPtr _
) As HResult
public virtual HResult DrawUnderline( 
   System.object clientDrawingContext,
   System.float baselineOriginX,
   System.float baselineOriginY,
   GlyphOrientationAngle orientationAngle,
   ref Underline underline,
   System.IntPtr clientDrawingEffectPtr
)

パラメータ

clientDrawingContext
The application-defined drawing context passed to IDWriteTextLayout::Draw.
baselineOriginX
The pixel location (X-coordinate) at the baseline origin of the run where underline applies.
baselineOriginY
The pixel location (Y-coordinate) at the baseline origin of the run where underline applies.
orientationAngle
Orientation of the underline.
underline
Pointer to a structure containing underline logical information.
clientDrawingEffectPtr
Application-defined effect to apply to the underline. Usually this argument represents effects such as the foreground brush filling the interior of a line.

戻り値の型

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
解説
A single underline can be broken into multiple calls, depending on how the formatting changes attributes. If font sizes/styles change within an underline, the thickness and offset will be averaged weighted according to characters. To get an appropriate starting pixel position, add underline::offset to the baseline. Otherwise there will be no spacing between the text. The x coordinate will always be passed as the left side, regardless of text directionality. This simplifies drawing and reduces the problem of round-off that could potentially cause gaps or a double stamped alpha blend. To avoid alpha overlap, round the end points to the nearest device pixel.
参照

TextRenderer1Base クラス
TextRenderer1Base メンバ
オーバーロード一覧