//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Method: Start Drawing, sets the background color and clears the clip region, set tab and basic draw format. /// </summary> /// <param name="graphics"> The graphics.</param> /// <param name="background"> The background.</param> /// <param name="tabSize"> The tab Size.</param> /// <param name="font"> The font.</param> /// <param name="format"> [optional=(DrawFormat.DT_NOPREFIX | DrawFormat.DT_NOCLIP)] The format.</param> //////////////////////////////////////////////////////////////////////////////////////////////////////////////// public void StartDrawing(Graphics graphics, Color background, int tabSize, Font font, DrawFormat format = (DrawFormat.DT_NOPREFIX | DrawFormat.DT_NOCLIP)) { graphics.Clear(background); _dc = graphics.GetHdc(); _textParams = new DRAWTEXTPARAMS(tabSize); _format = format; SetBkMode(_dc, BkMode.TRANSPARENT); SelectFont(font); }
private static extern int DrawTextExW(IntPtr hDC, IntPtr lpszString, int nCount, ref RECT lpRect, int nFormat, [In, Out] DRAWTEXTPARAMS lpDTParams);
public static extern int DrawTextEx(HWND hdc, string lpsz, int n, ref RECT lpRect, int un, ref DRAWTEXTPARAMS lpDrawTextParams);