public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { RECT rect = pRect[0]; int rectWidth = rect.right - rect.left; int lineWidth = 8;// 2 + rectWidth / 20; uint clrFore; uint clrBack; ErrorHandler.ThrowOnFailure(pMarkerColors.GetMarkerColors(JiraLinkMarginMarkerType.Id, out clrFore, out clrBack)); int drawColorref = (int)clrFore; Color color = Color.FromArgb( drawColorref & 0x0000FF, (drawColorref & 0x00FF00) >> 8, (drawColorref & 0xFF0000) >> 16 ); using (Graphics graphics = Graphics.FromHdc(hdc)) using (SolidBrush brush = new SolidBrush(color)) { graphics.FillRectangle(brush, rect.left + (rectWidth - lineWidth) / 2, rect.top, lineWidth, rect.bottom - rect.top); } return(VSConstants.S_OK); }
public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { RECT rect = pRect[0]; int rectWidth = rect.right - rect.left; int lineWidth = 8;// 2 + rectWidth / 20; uint clrFore; uint clrBack; ErrorHandler.ThrowOnFailure(pMarkerColors.GetMarkerColors(JiraLinkMarginMarkerType.Id, out clrFore, out clrBack)); int drawColorref = (int)clrFore; Color color = Color.FromArgb( drawColorref & 0x0000FF, (drawColorref & 0x00FF00) >> 8, (drawColorref & 0xFF0000) >> 16 ); using (Graphics graphics = Graphics.FromHdc(hdc)) using (SolidBrush brush = new SolidBrush(color)) { graphics.FillRectangle(brush, rect.left + (rectWidth - lineWidth) / 2, rect.top, lineWidth, rect.bottom - rect.top); } return VSConstants.S_OK; }
public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { Image image = Resources.MarkerImage; Graphics graphics = Graphics.FromHdc(hdc); graphics.DrawImage(image, pRect[0].left, pRect[0].top, pRect[0].left + pRect[0].right, pRect[0].bottom - pRect[0].top); return(VSConstants.S_OK); }
public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { RECT rect = pRect[0]; using (Graphics graphics = Graphics.FromHdc(hdc)) { graphics.DrawImage(jiraGlyph, rect.left, rect.top); } return(VSConstants.S_OK); }
public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { return(VSConstants.S_OK); }
/// <summary> /// Draws a glyph in the given display context and bounding rectangle using the provided colors. /// </summary> /// <returns> /// If the method succeeds, it returns <see cref="F:Microsoft.VisualStudio.VSConstants.S_OK"/>. If it fails, it returns an error code. /// </returns> /// <param name="hdc">[in] Handle to a display device context that defines the visible region of interest. /// </param><param name="pRect">[in] Pointer to a RECT structure that defines the bounding rectangle for the marker. /// </param><param name="iMarkerType">[in] Integer containing the marker type. /// </param><param name="pMarkerColors">[in] Pointer to a marker colors object. /// </param><param name="dwGlyphDrawFlags">[in] Options for drawing the glyph in the widget margin. For a list of <paramref name="dwGlyphDrawFlags"/> values, see <see cref="T:Microsoft.VisualStudio.TextManager.Interop.GLYPHDRAWFLAGS"/></param><param name="iLineHeight">[in] Integer specifying the line height. /// </param> public virtual int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { return VSConstants.E_NOTIMPL; }
public int DrawGlyphWithColors(IntPtr hdc, RECT[] pRect, int iMarkerType, IVsTextMarkerColorSet pMarkerColors, uint dwGlyphDrawFlags, int iLineHeight) { throw new Exception("The method or operation is not implemented."); }