使用提供的颜色,绘制标志符号在特定显示上下文和边框。
命名空间: Microsoft.VisualStudio.TextManager.Interop
程序集: Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)
语法
声明
Function DrawGlyphWithColors ( _
hdc As IntPtr, _
pRect As RECT(), _
iMarkerType As Integer, _
pMarkerColors As IVsTextMarkerColorSet, _
dwGlyphDrawFlags As UInteger, _
iLineHeight As Integer _
) As Integer
int DrawGlyphWithColors(
IntPtr hdc,
RECT[] pRect,
int iMarkerType,
IVsTextMarkerColorSet pMarkerColors,
uint dwGlyphDrawFlags,
int iLineHeight
)
int DrawGlyphWithColors(
[InAttribute] IntPtr hdc,
[InAttribute] array<RECT>^ pRect,
[InAttribute] int iMarkerType,
[InAttribute] IVsTextMarkerColorSet^ pMarkerColors,
[InAttribute] unsigned int dwGlyphDrawFlags,
[InAttribute] int iLineHeight
)
abstract DrawGlyphWithColors :
hdc:IntPtr *
pRect:RECT[] *
iMarkerType:int *
pMarkerColors:IVsTextMarkerColorSet *
dwGlyphDrawFlags:uint32 *
iLineHeight:int -> int
function DrawGlyphWithColors(
hdc : IntPtr,
pRect : RECT[],
iMarkerType : int,
pMarkerColors : IVsTextMarkerColorSet,
dwGlyphDrawFlags : uint,
iLineHeight : int
) : int
参数
hdc
类型:IntPtr[in] 用于定义可视区域相关的显示设备上下文的句柄。
pRect
类型:array<RECT[][in] 用于定义标记的边框的 RECT 结构的指针。
iMarkerType
类型:Int32[in] 包含标记类型的整数。
pMarkerColors
类型:Microsoft.VisualStudio.TextManager.Interop.IVsTextMarkerColorSet[in] 若要标记的指针为对象。
dwGlyphDrawFlags
类型:UInt32[in] 绘制标志符号的选项卡小部件边距。 有关 dwGlyphDrawFlags 值列表,请参见 GLYPHDRAWFLAGS
iLineHeight
类型:Int32[in] 指定行高的整数。
返回值
类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 textmgr.idl:
HRESULT IVsPackageDefinedTextMarkerType::DrawGlyphWithColors(
[in] HDC hdc, [in] RECT *pRect,
[in] long iMarkerType,
[in] IVsTextMarkerColorSet *pMarkerColors,
[in] DWORD dwGlyphDrawFlags,
[in] long iLineHeight
);
,如果您为标记类型,指定 MV_GLYPH 的值此方法由环境调用。 若要使用此方法,请绘制在边框内的 hdc 参数相关指定的可见区域的标志符号。 而不是硬编码的颜色,请使用 pMarkerColors 参数调用 GetMarkerColors ,并从当前标记的颜色键入或相关标记,以便使用用户的颜色自定义同步。 这个原因 IVsTextMarkerColorSet 用于确定颜色为这些标记类型使用与它们的内联文本颜色不同的和键控其他标记的标志符号颜色。
请遵循下列准则,当实现 DrawGlyphWithColors时:
不要绘制的返回与 pRect 参数的外部边框。
使用图形 (GDI)设备接口 (gdi) 基元 (而不是位图,,因为行的大小可能会有所不同中的一个宽数字,并且需要图像缩放。 但是,因此,如果要使用位图,对于辅助功能请提供了各种各样的位图大小,使您可以拉伸行为的它们在用户能够将中的所有可用的行的大小上,包括非常大大小需要。
不要绘制在标记中的任何文本都称为的用途。 泛型符号,如感叹号,将不鼓励。
如果在标记样式指定了 MV_MULTILINE_GLYPH 的值,此函数为每绘制通过调用两次 —一次绘制标志符号的内部和尾和重新绘制该顶部。 dwGlyphDrawFlags 的值传递到此方法指示下一步操作:
如果 GDF_MULTILINE 未通过,则请绘制标记的上边缘。
如果 GDF_MULTILINE指定,则必须执行基于其他标志的某些计算填充标记标志符号区域。 如果 GDF_BOTTOMEDGE通过,则使用输入边框的底部行高的部分绘制标志符号的尾。 如果 GDF_TOPEDGE 通过,则使用顶部行高的部分绘制标志符号的顶部。 输入边框的剩余空间是内部,并且应由函数绘制。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。