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
Post a Comment