@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The LineTo API !!!!C# Signature: [DllImport("gdi32.dll")] static extern bool LineTo(IntPtr hdc, int nXEnd, int nYEnd); !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: // create a bitmap and get a pointer suitable for GDI Bitmap maskImage = new Bitmap (width, height); Graphics maskg = Graphics.FromImage(maskImage); IntPtr maskHbitmap = maskImage.GetHbitmap(); void PaintLine3(IntPtr hbitmap, Point start, Point end, bool erase) { IntPtr pTarget = maskg.GetHdc(); IntPtr pDC = CreateCompatibleDC(pTarget); IntPtr pOrig = SelectObject(pDC, hbitmap); Color penColor = Color.Blue; int penWidth = 20; IntPtr pen = CreatePen(PenStyle.PS_SOLID | PenStyle.PS_GEOMETRIC | PenStyle.PS_ENDCAP_ROUND, penWidth, (uint)ColorTranslator.ToWin32(penColor)); // select the pen into the device context IntPtr oldpen = SelectObject(pDC, pen); MoveToEx(pDC, start.X, start.Y, IntPtr.Zero); LineTo(pDC, end.X, end.Y); // select the old pen back DeleteObject(SelectObject(pDC, oldpen)); SelectObject(pDC, pOrig); maskg.ReleaseHdc(); } !!!!Alternative Managed API: Do you know one? Please contribute it! Documentation: LineTo@msdn on MSDN
Edit gdi32.lineto
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.