c# - How to expand a line to make a rectangle or region -


i working on .net2 dont have access line class in .net3, though im not sure if work.

but have line (2 points)

and want expand width of 4 i.e. drawline on graphics, cannot find easy way region/ graphics path or rectangle this.

anyone know? , line can in direction.

i have found way this,

graphicspath gfxpath = new graphicspath(); gfxpath.addline(line.x1, line.y1, line.x2, line.y2); gfxpath.widen(new pen(color.blue, linethickness));//linethinkness matters region reg = new region(gfxpath);  if (reg.isvisible(mousepoint)) // return true if mousepoint within region. 

this widens line linethickness, , can use check if point or rect etc within it.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -